
You will get an idea as to which API's inside ffmpeg you should call. Here, you can see the code where encoding/decoding is done. But i can guide you in following ways.ġ) Inside the ffmpeg directory of source code, you have output_example.c or api_example.c. Now to answer the question of how to use this library, i would say that it is not so simple to write it here. It supports different formats of codecs and containers. ffmpeg is an effort in improving it day by day. The best documentation can be found in the headers.įor various reasons, Multimedia was and is never easy in terms of achieving the task without compromising on efficiency. Regarding using ffmpeg for playback, there are many examples (the ffmpeg binary itself is a good example), here's a basic tutorial. There's enough documentation on JNI out there, you should be fine.

Use the ffmpeg-wrapping dynamic library from your java sources. The NDK allows you to easily link against the static libraries you've generated in step 1, just add a line similar to this to Android.mk: LOCAL_STATIC_LIBRARIES := libavcodec libavformat libavutil libc libz Basically you'll need to write some C/C++ code to export the functionality you need out of ffmpeg into a library java can interact with through JNI.

There's a lot of documentation out there on how to work with the NDK.

You'll need to extract bionic(libc) and zlib(libz) from the Android build as well, as ffmpeg libraries depend on them.Ĭreate a dynamic library wrapping ffmpeg functionality using the Android NDK. Simply place the sources under /external and make away. This was achieved by building olvaffe's ffmpeg android port ( libffmpeg) using the Android Build System.
