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

`ICameraStreamManager.FrameFormat.NV21` Produces Incorrect Colors

Open jreedy-riis opened this issue 9 months ago • 1 comments

While working with the MSDK 5.8.0, we have noticed an issue present in the frame formats for the cameraStreamManager.addFrameListener(). It seems that the FrameFormat.YUV420_888, FrameFormat.YUV444_888, FrameFormat.YUY2, and FrameFormat.NV21 produce a frame with incorrect colors. The only format that currently doesn't is FrameFormat.RGBA_8888. In my testing, this became present in the very first alpha version of 5.8.0 and is still present in 5.9.0.

I have attached sample images to show the issue. The first image is a screenshot from the putCameraStreamSurface, the second image is from the addFrameListener with the format of RGBA_8888 and the last image is of NV21. As you can see, the image from the controller and the RGBA_8888 look very similar, however, when you compare it to the image taken from NV21, the image has colors that appear much darker, almost as if a filter is being applied on top. In addition, during my testing I have noticed details in darker areas of the image have become lost when using NV21.

Because of this issue, I cannot use the NV21 frame format directly, I must first convert the RGBA_8888 byte array to an NV21 byte array in order to get the correct format.

In my further testing, it also looks like the deprececated .addYuvDataListener also experiences this same issue on 5.8.0, but not on 5.7.0.

Image Pulled from DJI RC Plus

5 9-app_screen-cropped

Frame with RGBA_8888

5 9-normal-cropped

Frame with NV21

5 9-nv21-cropped

jreedy-riis avatar May 16 '24 14:05 jreedy-riis