Encode a series of Images into a Video

Rad The Mad picture Rad The Mad · Sep 11, 2010 · Viewed 25.2k times · Source

How can I create a video file from a series of images/photos on Android? Can this be done with the current SDK? or do I need a codec library?

Answer

John J Smith picture John J Smith · Apr 14, 2011

I agree with Mark. Among the C/C++ libraries are ffmpeg here or X264 here. I have to say I havn't found them or the Android NDK easy to use but that's probably because I don't really know much about C/C++ and JNI. If you're interested in this route, then the RockPlayer free app for Android has the pre-built shared libraries from ffmpeg ready for use on Android. They claim these libraries only use LGPL components but you'd have to satisfy yourself on this, I guess. With regards to Java, there is a port (of sorts) of ffmpeg called, unsurprisingly, jffmpeg which you can access here but it still calls out to much of the existing ffmpeg framework, so you're back in NDK land. It is possible to convert a series of images to video with the Java Media Framework (JMF) but it has the following drawbacks:

  1. Limited number of video formats.
  2. Doesn't produce videos which can be played back on most (if not all) Android phones e.g. H264 or MPEG4.
  3. The JMF code is now quite old, hasn't progressed in a long time, is bloated and not well structured so there may be additional Java dependencies which are not packaged in Android.

Another option I've seen used is Adobe Air, but it's a 17Mb payload which some users complain about.

There are lots of other questions here on Stack Overflow regarding ffmpeg and Android NDK.

Good luck with the project.