opentok / opentok-android-sdk-samples

Sample applications illustrating best practices using OpenTok Android SDK.
https://tokbox.com/developer/sdks/android/
MIT License
211 stars 169 forks source link

Publisher custom video renderer shows video with inverted colour only #501

Closed WCRohit closed 6 months ago

WCRohit commented 7 months ago

Describe the bug In my application, we want to get publisher frame buffer to be used to draw skeleton using MLKit. For this as per my understanding we have to use Custom Video Renderer and from this class "onFrame(frame: Frame)" function we will get frame buffer and use the buffer for getting image. The issue is when we use the CustomVideoRenderer from examples of OpenTok, the video we gets has inverted colour.

Expected behavior Expected behaviour is in case if we can get a custom renderer with normal video for Publisher class.

Additional context Additionally, are we doing anything wrong for getting Publisher Frame? Also, I am not proficient in OpenGL implementation at all, if you can give example for "GLSurfaceView.Renderer" implementation.

Thanks a lot in advance.

WCRohit commented 6 months ago

Hi, I guess the issue is coming because of the YUV format of Frame Buffer. What I have tried at my end is using "io.github.crow_misia.libyuv" library to convert YUV format to ArgbBuffer format. But the issue is still same with green background in foreground. Can You please help on this? Thanks

v-kpheng commented 6 months ago

@WCRohit , just checked up with the team, the inverting was intentional. Reason being, we wanted the "custom" part of the rendering to be evident.

WCRohit commented 6 months ago

@v-kpheng Thanks for your reply, Understood the reason. Closing the ticket.