androidunity-game-enginevlclibvlc

full sbs (side by side) video displays abnormally using libvlc + unity


I'm facing with a problem that some of my full SBS trailer videos show strange wide black borders in Unity.

I wrote a wrapper to wrap the libvlc into the aar so that I can cooperate Texture2D in Unity and the SurfaceTexutre in Android OS. Everything worked fine for most of the videos until I played some full SBS videos.

It seems that there's nothing wrong with the metadata. The width and height received from the function were correct, which means the black border is part of the texture. But when I was running my Android demo application or the VLC Android version, there was no black border on the screen. What can I do to fix this?

screenshot


Solution

  • Well guess I've figured out what to do.

    The reason is that all of the full sbs videos are 3840x1080 pixels, but the SAR (sample aspect ratio) and the DAR (Display aspect ratio) may be slightly different. In this occasion, this problematic video has a 0.5 SAR and 16:9 DAR in the file which caused the horizontal black border. so: