dji-sdk / Mobile-UXSDK-Android

DJI Mobile UXSDK is a suite of product agnostic UI objects that fast tracks the development of Android applications using the DJI Mobile SDK.
Other
152 stars 110 forks source link

关于FPVWidget在M300上掉帧的问题 #136

Open Swordce opened 2 years ago

Swordce commented 2 years ago

看了下LiveStreamManager的原理,所以这个问题也会导致视频直播也会出现丢帧等问题,在CompleteWidgetActivity中开启直播即可复现这个问题,这个也是LiveStreamManager的缺陷造成的问题吗?有没有方法能进行优化

dji-dev commented 2 years ago

Agent comment from DJI SDK in Zendesk ticket #58424:

尊敬的开发者,感谢您联系DJI 大疆创新 由于github不是我们主要的咨询渠道,您的问题可能跟进不及时。我们建议您通过填写表单( https://djisdksupport.zendesk.com/hc/zh-cn/requests/new )向我们反馈问题。或者您也可以在论坛发帖,与其它开发者交流。论坛链接:https://djisdksupport.zendesk.com/hc/zh-cn/community/topics

Dear developer, thank you for contacting DJI. Since github is not our main consultation channel, your questions may not be followed up in time. We recommend that you fill in the form (https://djisdksupport.zendesk.com/hc/en-us/requests/new) to report problems to us. Or you can post in the forum to communicate with other developers. Forum link: https://djisdksupport.zendesk.com/hc/zh-cn/community/topics

°°°

Swordce commented 2 years ago

@dji-dev @DJI-William

DJI-William commented 2 years ago

不应该会出现丢帧问题,我们测试过没有出现。出现丢帧大概率是安卓设备的配置问题,因为我们是用安卓自身的解码器硬解码的。解决办法就是提高码率,降低分辨率。

Swordce commented 2 years ago

使用的是pm430带屏遥控器,在CompleteWidgetActivity中添加下面这段代码,移动云台就能看到明显丢帧了 image

DJI-William commented 2 years ago

Audio这块不要改false,videoEncoding打开试试,借鉴一下Android Sample的推流代码,另外跑一下Android Sample的推流代码看看有没有问题。

Swordce commented 2 years ago

Android Sample中仅有一个videofeedview,业务场景比较简单,CompleteWidgetActivity类更符合实际场景,开启推流后,内存抖动更加明显。个人感觉可能是频繁的gc导致fpvwiget出现掉帧、抖动

Swordce commented 2 years ago

你们使用ux的demo无法复现这个问题么?

Swordce commented 2 years ago

@DJI-William

Swordce commented 2 years ago

image 从日志看,gc时间间隔很短,ux的demo中也一样

Swordce commented 2 years ago

@DJI-William

DJI-William commented 2 years ago

晚点处理。

Swordce commented 2 years ago

意思是下个版本会处理这个问题么。。

DJI-William commented 2 years ago

image 我照着你代码测试写了一下,你代码设置有一些问题,没有任何问题,你按照我的代码测试一下。

Swordce commented 2 years ago

好的,我按照图上的重新测试一下

Swordce commented 2 years ago

测试后还是有问题,我这边录了个屏,可以提供个渠道发视频给你们吗

DJI-William commented 2 years ago

我觉得可能是你的网络问题了。我这边测试是没有问题的。 Link:https://pan-sec.djicorp.com/s/YR8cHPN33WC5t2Q dji123

Swordce commented 2 years ago

飞机和遥控器的固件版本会影响到这个么

DJI-William commented 2 years ago

不会,这个是很基础的重要功能,一般不会轻易动它。

Swordce commented 2 years ago

视频已经传上去了,视频里能看出来云台转一转画面就跳一下

DJI-William commented 2 years ago

看到了,但是你这个应该和直播无关吧?我看是你的图传在卡。你转动云台过快会这样,你试着缓慢转动云台看看会不会这样。首先我们要了解视频流的原理,是由I帧-P帧-P帧-P帧-I帧,这样的顺序来的,I帧存有整个图像的数据,P帧存储地是对比之前的I帧的矢量变化,必须要知道I帧,再知道I帧和后面每一帧的差来计算出下面的帧。如果这个变化太大,是算不出来的,只有等到下一个I帧才能刷新,也就出现了跳一下的效果。