dji-sdk / Mobile-SDK-Android

DJI Mobile SDK for Android: http://developer.dji.com/mobile-sdk/
Other
972 stars 579 forks source link

M300 gray colors when decoding stream #764

Open mordka opened 3 years ago

mordka commented 3 years ago

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?

dji-dev commented 3 years ago

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

mordka commented 3 years ago

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

hari0603 commented 1 year ago

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.