Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommended Java library for creating a video programmatically [closed]

Tags:

java

video

media

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.

like image 694
Neil Coffey Avatar asked Feb 17 '12 19:02

Neil Coffey


2 Answers

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/

like image 114
janoside Avatar answered Sep 29 '22 07:09

janoside


I found a tool called ffmpeg which can convert multimedia files form one format to another. There is a filter called libavfilter in ffmpeg which is the substitute for vhook which allows the video/audio to be modified or examined between the decoder and the encoder. I think it should be possible to input raw frames and generate video. I researched on any java implementation of ffmpeg and found the page titled "Getting Started with FFMPEG-JAVA" which is a JAVA wrapper around FFMPEG using JNA.

like image 35
Muk Bo Avatar answered Sep 29 '22 05:09

Muk Bo