我正在使用agora进行一对一直播。因此,我的代码中有一个广播员和多个受众。
await AgoraRtcEngine.enableWebSdkInteroperability(true);
AgoraRtcEngine.setParameters('{\"che.video.lowBitRateStreamParameter\":
{\"width\":320,\"height\":180,\"frameRate\":15,\"bitRate\":140},
{\"che.video.keep_prerotation\":false},{\"che.video.local.camera_index\":1025}}');
await AgoraRtcEngine.setChannelProfile(ChannelProfile.LiveBroadcasting);
await AgoraRtcEngine.setClientRole(ClientRole.Audience);
await AgoraRtcEngine.joinChannel(null, channelName, null, 0);
工作正常。但是问题是视频太放大了,因此无法使用。 关于stackoverflow的这个问题还有一个问题: Video stream is more zoomed than I'd like and isn't the same as the local stream view. How can I fix this?
对此可接受的解决方案是:请在加入频道之前添加以下代码,这应该会有所帮助-
setParameters:@“ {\” che.video.keep_prerotation \“:false}” setParameters:@“ {\” che.video.local.camera_index \“:1025}”
但是对我来说,该解决方案不起作用。您可以看到,我已经按照答案的建议添加了参数。 甚至指向github的链接都显示404。 谁能帮我解决这个问题。
答案 0 :(得分:1)
您必须在参数内添加以下详细信息以及您提到的代码:
setParameters("{"che.audio.live_for_comm":true}")
也可以通过以下方式固定缩小的框:
您可以通过调用
来设置视频配置文件setVideoEncoderConfiguration()
通过此操作,您可以设置视频配置文件。您可以在此处获取有关这些配置文件的详细信息:https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1video_1_1_video_encoder_configuration.html#a50e755074e254026b51dfaa2e3dc91d9
您也可以尝试将方向定义为横向或纵向,然后查看结果。
在设备设置中,如果屏幕尺寸或文本尺寸增加,也可以将其更改为默认值,然后尝试再次运行。