how to use ffmpeg on android

后端 未结 3 1143
自闭症患者
自闭症患者 2020-12-12 04:12

I want to create video file from Jpeg and audio file. I\'ve compiled FFMpeg to android and I\'ve got libffmpeg.so, and obj folder with ithers resources.

But how to u

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-12 04:47

    You may use JNI interface to call functions from a library, in your case ffmpeg library. Here is a basic tutorial of JNI: http://marakana.com/forums/android/examples/49.html

    To put simply, JNI is the bridge between your Java code and C code.

    In order to call ffmpeg as in command line from your Java code, You may include ffmpeg.c (and other needed files) into your jni interface (under jni directory) and compile it along with your other jni code, so that you may call ffmpeg's main function with arguments just like the command line.

提交回复
热议问题