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

M300 gray colors when decoding stream

Open mordka opened this issue 4 years ago • 3 comments

We are building livestraming application for M300 model, and we are using DJIVideoStreamDecoder to capture the raw h264 frames. However the video that we display on the Surface has broken colors and it's mostly gray. we set ssignSourceToPrimaryChannelPhysicalSource.LEFT_CAM, PhysicalSource.FPV_CAM) and setting format to MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar This application works fine with other models like Mavic. Apparently the received video livestram is much diffenent to other models Is m300 chosed different pixel format?

mordka avatar Feb 04 '21 23:02 mordka

Agent comment from William Wong in Zendesk ticket #43747:

Dear Client Thank you for contacting DJI.

Please try this demo, you should get fine video streaming by custom decoder. And then you can modify it to the your custom livestreaming application. Link:https://github.com/DJI-Mobile-SDK-Tutorials/Android-VideoStreamDecodingSample

Hopefully our solution can help you. Kindly Regards, DJI Developer Support

dji-dev avatar Feb 05 '21 06:02 dji-dev

Hi @dji-dev after further investigation we are able to decode the image locally on all FPV, wide, zoom, and infrared lenses on M300. However we are passing the YUV frames to rtmp livestream which is lacking full colors. We also found that we are able to do livestream with full color on Android 10 phone but it's gray livestream on Smart controller which runs on Android 7.1.2 RM500-ent kernel 4.4.83

mordka avatar Feb 24 '21 14:02 mordka

Hi @mordka, I am facing a similar problem with DJI Air 2S when using the same Smart controller and Android version. Were you able to resolve/overcome this issue?

One more thing that I noticed was that the colorFormat returned in the onYuvDataReceived callback is 0, which is not present in the MediaCodecInfo.CodecCapabilities enum class.

hari0603 avatar Mar 08 '23 19:03 hari0603