简体   繁体   中英

How to use prebuilt FFmpeg in Android Studio

I'm sure this is a very basic question but since this is the my first time messing around with the NDK, a lot of thing is still very unclear to me.

Use case:

  • I'm trying to develop a video scrubbing feature so fast and accurate frame seeking is crucial. I've tried most of the available players out there but the performance is still not up to my demand. That's why I'm going down the FFmpeg route.

  • Basically, what I'm looking for is FFmpeg input seeking . I've tried WrtingMinds' ffmpeg-android-java . However it is a file based implementation which means the out.jpg need to be written to external memory and read back which has a big hit on performance (roughly 1000 milliseconds for 1 seek).

  • That's why I'm trying to built my own FFmpeg player to do the input seeking in JNI and push back the byte[] to be displayed in Java.

Question: After a lot of struggling with the NDK, I've managed to set it up and successfully calling the JNI method from my Java code. The structure is as below:

MyApp
  -app
  -MyFFmpegPlayer
    -build
    -libs
    -src
      -main
        -java
          -com.example.myffmpegplayer
            +HelloJNI.java
        -jni
          +MyFFmpegPlayer.c

After some fail attempt to build FFmpeg on Windows, I've decided to use WritingMinds prebuilt FFmpeg. However, after extraction they just come up as plain ffmpeg files (not .so file) so I don't really know how to use these.

It would be a great gratitude, if someone can just chime in and give me a good starting point for my next step.

Thank you so much for your time.

So to answer my own question which I should change to "How to build FFmpeg and use it with Android Studio", I have create a detail step-by-step instruction that's working for me (at May 24th 2016 ).

Sorry I can't post the whole instruction here as it is very long, plus it is easier for me to keep 1 source of information up-to-date.

I hope this can help someone as I know there is way too much confusing and contradicting information regarding this topic out there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM