opentok / opentok-android-sdk-samples

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

Custom video renderer is giving black and white video frame #502

Closed WCRohit closed 3 months ago

WCRohit commented 4 months ago

Describe the bug In my application I am working on to integrate MLKit SDK to show on body pose of publisher. For this I can see there is no direct function provided to get the frame and pass it on, I have to create a subclass of BaseVideoRenderer and from this I will get "onFrame" function that will give me Frame object. So, I created a subclass and tried to render the frame buffer on screen, it gives me black and white video frame with some red and green color on screen.

To Reproduce To reproduce the issue, we just have to subclass BaseVideoRenderer and draw the frame buffer we get in onFrame function

Expected behavior Expectedly, we should get normal video frame

WCRohit commented 4 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