Recommended Java library for creating a video programmatically

Neil Coffey picture Neil Coffey · Feb 17, 2012 · Viewed 22k times · Source

Can anyone recommend a Java library that would allow me to create a video programmatically? Specifically, it would do the following:

  • take a series of BufferedImages as the frames
  • allow a background WAV/MP3 to be added
  • allow 'incidental' WAV/MP3s to be added at arbitrarily, programmatically specified points
  • output the video in a common format (MPEG etc)

Can anybody recommend anything? For the picture/sound mixing, I'd even live with something that took a series of frames, and for each frame I had to supply the raw bytes of uncompressed sound data associated with that frame.

P.S. It doesn't even have to be a "third party library" as such if the Java Media Framework has the calls to achieve the above, but from my sketchy memory I have a feeling it doesn't.

Answer

janoside picture janoside · Feb 20, 2012

I've used the code mentioned below to successfully perform items 1, 2, and 4 on your requirements list in pure Java. It's worth a look and you could probably figure out how to include #3.

http://www.randelshofer.ch/blog/2010/10/writing-quicktime-movies-in-pure-java/