Video rotation on android using LibVLC

后端 未结 1 411
Happy的楠姐
Happy的楠姐 2021-01-03 14:03

I\'m using LibVLC to display video files. It\'s working fine so far, despite of the orientation. I\'m able to get the orientation out of meta-data but don\'t really know how

1条回答
  •  遥遥无期
    2021-01-03 15: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.

    0 讨论(0)
提交回复
热议问题