Mobile-SDK-Android icon indicating copy to clipboard operation
Mobile-SDK-Android copied to clipboard

DJICodecManager onYuvDataReceived not called at 30FPS

Open tomups opened this issue 6 years ago • 4 comments

Using SDK 4.11, I'm enabling enabledYuvData for the DJICodecManager, but it's really slow!

I have been timing the delay between calls to onYuvDataReceived and it fluctuates between 200 and 300ms, which gives me 3-5 fps! That's too slow. Why is it called not so often, and what can I do to improve it?

I have tried in a BlackBerry Key2, and Oculus Quest. Same big delay in both.

In comparison, the onRecieved of VideoFeeder.VideoDataListener is called very quickly with data from the camera, so data is coming fast enough from the camera. An when using a SurfaceTexture in DJICodecManager, with no YUV data callback, the video is updated fast on screen. It's only with onYuvDataReceived that it's so painfully slow.

tomups avatar Nov 26 '19 01:11 tomups

How long does your "onYuvDataReceived" take to return? Depending on the resolution of the frame and your Android device it might take a long time, e.g. if you copy it to some other memory buffer.

kapejod avatar Dec 02 '19 09:12 kapejod

For measuring the call time, I didn't do any work inside onYuvDataReceived, only measuring the time between calls and exiting the callback. So it doesn't take any time to return.

tomups avatar Dec 02 '19 20:12 tomups

Hello @tomtastico!

I'm getting 30FPS and have onYuvDataReceived implemented. Perhaps you can share your solution as you might have some bottleneck in your implementation?

jeryini avatar Aug 06 '20 06:08 jeryini

Did anyone get a solution to this?? I am facing a similar issue where few frames are being skipped. Does anyone have any idea as to what might be causing this?

VineetTambe avatar Dec 22 '21 19:12 VineetTambe