Subject: | |
From: | |
Reply To: | |
Date: | Thu, 3 Nov 2005 14:50:44 +0100 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
I'm trying to write BufferedImages to a videofile and came across the
MovieEncoder.
It works brilliantly, except that the last of the images does not appear
in the movie file.
Here is a little explanation of what I did:
- I have a reader class which reads DataObjects with time stamp from a
file.
- I have written a writer class which creates a BufferedImage
visualizing the data and timestamp. The BufferedImage is passed to the
add Method of the MovieEncoder (I call the getEncodingFormats method and
constructor before hand).
- the reader and writer classes are connected via a thread: as long as
the reader returns data, the writer will do it's job. Once all data is
read, the stop() method of the MovieEncoder is called.
The syntax of the add-method looks like this:
System.out.println("Added image to movie: " + movie.add(bimg) + " at
timestep: " + time.toString());
At runtime the last image is added:
Added image to movie: true at timestep: 31.01.1995 12:00
yet in the movie file the last image is of 30.01.1995.
I also noticed that although my program runs to the end I have to
manually exit the programm after running it.
Does anyone know where I'm going wrong?
Any help is greatly appreciated.
Best regards,
Anja Colgan
|
|
|