Video rotation on android using LibVLC

蹲街弑〆低调 提交于 2019-11-30 16:10:00

I had a similar problem. Unfortunately LibVLC for android does not expose all features, so I had to change code in the jni layer to get it working. Here is how to do it:

Edit libvlcjni.c, and find the function : Java_org_videolan_libvlc_LibVLC_nativeInit. Look for the local varibale argv array and add the following to items to it:

"--video-filter=transform" "--transform-type="

Where transform type is one of the following: 90, 180, 270, hfilp, vfilp.

If you omit --transform-type you'l get a 90 degree rotation by default.

What this modifications does, is it loads the transform filter and then sets the transformation. You can do more fine grained rotation using --rotation-angle, but you'll have to load the appropriate filter first.

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!