Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

100% Java encoder for AVI animation

I am looking for a 100% Java solution for encoding software generated images into an AVI stream together with an uncompressed audio track.

At the moment I am using JMF, but its size and installation problems make it a bad solution for my purpose.

like image 927
Timo Avatar asked Dec 13 '22 02:12

Timo


2 Answers

While it does not support audio, I created an MJPEG AVI Java class some years ago. You basically just tell it the resolution of your output video, along with the frame rate, then you just keep adding images to it. When you are done, you tell it to finish and it'll close out the AVI. It is based off of the Microsoft documentation on AVI, RIFF, and BITMAP file formats.

Other than not supporting audio, the only real problem is it implements the version of the AVI format limited to 2GB per file. While the class will write out a much larger file, I am uncertain that any players or video editors would be able to read it.

The way I've used this code in the past, is to generate an MJPEG AVI for processing in a video editor (adding audio, etc. in the editor). It helped me with automating some tedious slide show generation. Not sure if this code will help you, as is, but it might help if you are trying to roll your own solution. MJPEGGenerator.java is available if you are interested!

like image 167
monceaux Avatar answered Dec 29 '22 05:12

monceaux


You can use JMF, see this nice example.

like image 41
Zed Avatar answered Dec 29 '22 04:12

Zed