Agora远程视频也放大了

时间:2020-03-28 08:21:00

标签: flutter agora.io

我正在使用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}”

请参阅演示代码:https://github.com/AgoraIO-Community/Agora-Video-With-FaceUnity-iOS/blob/d777df2aac725bce120f9e8c4d599d026d2c9d79/AgoraWithFaceunity/Controllers/RoomViewController.m#L110

但是对我来说,该解决方案不起作用。您可以看到,我已经按照答案的建议添加了参数。 甚至指向github的链接都显示404。 谁能帮我解决这个问题。

1 个答案:

答案 0 :(得分:1)

您必须在参数内添加以下详细信息以及您提到的代码:

setParameters("{"che.audio.live_for_comm":true}")

也可以通过以下方式固定缩小的框:

  1. 您可以通过调用

    来设置视频配置文件

    setVideoEncoderConfiguration()

通过此操作,您可以设置视频配置文件。您可以在此处获取有关这些配置文件的详细信息:https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1video_1_1_video_encoder_configuration.html#a50e755074e254026b51dfaa2e3dc91d9

  1. 您也可以尝试将方向定义为横向或纵向,然后查看结果。

  2. 在设备设置中,如果屏幕尺寸或文本尺寸增加,也可以将其更改为默认值,然后尝试再次运行。