This tiny library used together with JMF
allows to produce movies from
an array of images. The supported outputs are Quicktime (JPEG
compression) and MSVideo (MJPEG compression or RAW). It allows to
produce a movie with few lines of code!
For a project I was working on I needed to create a
movie, based on images loaded into some JPanels. This wasn't the first
time I had to do something like this, but instead of using the standard JMF solution
and adapt the code, I've tried to do something more generic that I
could use easily in the future. This was why Jim2Mov was created...
The class that allows you to create movies is named Jim2Mov
. In order to use it, your code must implement two interfaces: MovieInfoProvider
. There is also a default implementation of MovieInfoProvider, named DefaultMovieInfoProvider
, which in most cases you will want to use. If you want to be warned when a frame is saved, implement FrameSavedListener
and register it in your Jim2Mov instance.
From here the creation of movies is straightforward.
Please notice that if you are going to save a movie where your images
are encoded as JPEG, your ImageProvider must return JPEGs. There is
also an utility class
that helps you in the creation of images. These can be BufferedImages
from a JPanel (for instance), a file, the internet, you decide.
The project is licensed under the GNU Lesser General Public License.
You must have the latest version of the cross platform JMF
you can find a very simple example that reads an array of image files and saves it as a movie.