gpt4 book ai didi

error: AgoraclientException, AgorachannelException, AgoraRtcException(-8, null), and rtmpStreaming video is not being pushed to the server(错误:没有将AgoraclientException、AgorachannelException、AgoraRtcException(-8,NULL)和rtmpStreaming视频推送到服务器)

转载 作者:bug小助手 更新时间:2023-10-26 20:34:29 24 4
gpt4 key购买 nike



error: AgoraclientException, AgorachannelException, AgoraRtcException(-8, null), and I/agora.io(21795): (00000287): BaseStreamProxy::onRtmpStreamingStateChanged(this:0xb400007b5acdc780, url: rtmp://live-fra.twitch.tv/app/{streamke}, state: 4, errorCode: 16) I/agora, how do i solve such problems``

错误:AgoraclientException、AgorachannelException、AgoraRtcException(-8,NULL)和I/agora.io(21795):(00000287):BaseStreamProxy::onRtmpStreamingStateChanged(this:0xb400007b5acdc780,URL:RTMP://live-fra.twitch.tv/APP/{Streamke},状态:4,错误代码:16)i/agora,如何解决此类问题``


`
`Future<void> initAgora() async {
await [Permission.microphone, Permission.camera].request();
engine = createAgoraRtcEngine();
addUser(0, userId);
_client = await AgoraRtmClient.createInstance(appId);
await engine?.initialize(const RtcEngineContext(
appId: appId,
channelProfile: ChannelProfileType.channelProfileLiveBroadcasting,
));
try {
_channel=await _client?.createChannel(channel);
showDialog(context: context, builder: (context) {
return AlertDialog(
title: Center(child: Text('created channel succesfully')),
content:Text('')); });
} catch (error) {
showDialog(context: context, builder: (context) {
return AlertDialog(
title: Center(child: Text('error')),
content:Text('$error')); });
}
try {
await _client?.login(token, userId);
showDialog(context: context, builder: (context) {
return AlertDialog(
title: Center(child: Text('logged in succes fully $userId')),
content:Text('')); });`
} catch (error) {
showDialog(context: context, builder: (context) {
return AlertDialog(
title: Center(child: Text('error')),
content:Text('$error')); });

}
try {
await _channel?.join();

showDialog(context: context, builder: (context) {
return AlertDialog(
title: Center(child: Text('joined succesfully')),
content:Text('')); });
} catch (error) {
showDialog(context: context, builder: (context) {
return AlertDialog(
title: Center(child: Text('error')),
content:Text('$error')); });
}
try{
_channel?.onMemberJoined=(RtmChannelMember member){
setState(() {

addUser(remote, member.userId);
});
showDialog(context: context, builder: (context) {
return AlertDialog(
title: Center(child: Text('member joint')),
content:Text('${member.userId}')); });

};}catch(error){
showDialog(context: context, builder: (context) {
return AlertDialog(
title: Center(child: Text('error')),
content:Text('$error')); });
}
engine?.registerEventHandler(
RtcEngineEventHandler(
onJoinChannelSuccess: (RtcConnection connection, int elapsed) {
debugPrint("local user ${connection.localUid} joined");
setState(() {
localUserJoined = true;
activeuid=connection.localUid!;
});
},
onUserJoined: (RtcConnection connection, int remoteUid, int elapsed){
addUser(remoteUid, userId);
setState(() {
remote=remoteUid;
remoteuid.add(remoteUid);
});
},
onUserOffline: (RtcConnection connection, int remoteUid, UserOfflineReasonType reason) {
uidToPeerIdMap.remove(remoteUid);
debugPrint("remote user $remoteUid left channel");
setState(() {
remoteuid.remove(remoteUid);
});
},
onTokenPrivilegeWillExpire: (RtcConnection connection, String token) {
debugPrint('[onTokenPrivilegeWillExpire] connection: ${connection.toJson()}, token: $token');
},
),
);
await engine?.enableVideo();
await engine?.startPreview(sourceType: VideoSourceType.videoSourceCamera);
await engine?.isCameraZoomSupported();
await engine?.getCameraMaxZoomFactor();
await engine?.switchCamera();
await engine?.setClientRole(role: ClientRoleType.clientRoleBroadcaster);
await engine?.setVideoEncoderConfiguration(VideoEncoderConfiguration(
bitrate:6000,
minBitrate:1500,
frameRate: 30,
orientationMode: OrientationMode.orientationModeFixedLandscape,
));
await engine?.setRemoteDefaultVideoStreamType(VideoStreamType.videoStreamHigh);
await engine?.joinChannel(
token: token,
channelId: channel,
uid: uid,
options: ChannelMediaOptions(channelProfile:ChannelProfileType.channelProfileLiveBroadcasting),
);
await startStream();
}
static void addUser(int uids, String peerId) {
uidToPeerIdMap[uids] = peerId;
}
int activeuid=0;
int uid1=0;
Future<void>startStream()async{
try {
List<TranscodingUser>transcodingUsers = [];
transcodingUsers.add(TranscodingUser(uid: activeuid,
x: 0,
y: 0,
width: 960,
height: 540));
LiveTranscoding liveTranscoding = LiveTranscoding(
lowLatency: true,
videoFramerate: 15,
videoBitrate: 500,
userCount: 1,
transcodingUsers: transcodingUsers, width: 960,
height: 540);
await engine?.startRtmpStreamWithTranscoding(
url: rtmpIngestUrl, transcoding: liveTranscoding);
showDialog(context: context, builder: (context) {
return AlertDialog(
title: Center(child: Text('pushing successfully')),
content:Text('')); });

}catch(error){
showDialog(context: context, builder: (context) {
return AlertDialog(
title: Center(child: Text('error')),
content:Text('$error')); });

}
}` `

`

here is a sample code:
`

以下是一个示例代码:`


tried to edit the rtmpurl , tried different streaming platforms, tried reducing the settings of the video parameters eg bitrate, width,height still video is not bieng pushed. The AgoraRtmchannel &client tried to update SDK package but is already upto date .

尝试编辑rtmpul,尝试不同的流媒体平台,尝试降低视频参数的设置,如码率、宽度、高度,静止视频不是必推的。AgoraRtmChannel&客户端尝试更新SDK包,但已是最新的。


更多回答

Please trim your code to make it easier to find your problem. Follow these guidelines to create a minimal reproducible example.

请修改您的代码,以便更容易地找到您的问题。遵循这些指导原则,创建一个最小的可重现示例。

优秀答案推荐
更多回答

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com