Skip to main content

[JAVA2D] Creating AVI or MPEG files with JMF

3 replies [Last post]
Anonymous

Recently, my boss has asked me to create some AVI style movies from
screen captures of a Java3D application I've developed. I've figured
out how to capture BufferedImages at the right moments, but am unsure
how to write these to disk in an AVI or MPEG format. The docs on
java.com are very difficult to learn from and not much help at all. Is
there someone who could point me to a simple applicaiton that takes a
series of BufferedImages and writes a file to disk with them?

Mark McKay
--
http://www.kitfox.com

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Kevin Weiner

Mark McKay wrote:
>
> Recently, my boss has asked me to create some AVI style movies from
> screen captures of a Java3D application I've developed. I've figured
> out how to capture BufferedImages at the right moments, but am unsure
> how to write these to disk in an AVI or MPEG format. The docs on
> java.com are very difficult to learn from and not much help at all. Is
> there someone who could point me to a simple applicaiton that takes a
> series of BufferedImages and writes a file to disk with them?

See the JPEG to movie sample on the JMF Solutions page:
http://java.sun.com/products/java-media/jmf/2.1.1/solutions
That will show you how to create an AVI or QuickTime file.
MPEG is not a supported output format, so you'll have to
transcode from an avi or mov file using something like tmpgenc.
Note that there is a bug in the sample - it neglects to set
a time stamp on the output buffer which causes a bad avi to
be created. Check the jmf-interest list archive for more details.

---------------------------------------------------------------------
Kevin Weiner FM Software 610-997-3930 http://www.fmsware.com

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Bolius
Offline
Joined: 2006-02-17

Hi,

I have exactly the described problem. I want to create an AVI from JPG files. I am using the specified code sample and I have the bug that you descibed, Kevin! I have a bad AVI quality and even cannot play the AVI. You said there is a bug in the sample (time stamp). Unfortunately, I am not very good in programming, I just used the sources, and I have no experience with buffers and streams. So I`d please you to post a code example how to correct the bug in order to get a good AVI! I`ve tried the following: "buf.setTimeStamp (Buffer.FLAG_RELATIVE_TIME);", but it didn`t change anything.

Thanx a lot for any help!
Can

Keith Lea

You might want to look into IBM's java MPEG4 package, but it might not
be so easy to use.

-Keith

Mark McKay wrote:
> Recently, my boss has asked me to create some AVI style movies from
> screen captures of a Java3D application I've developed. I've figured
> out how to capture BufferedImages at the right moments, but am unsure
> how to write these to disk in an AVI or MPEG format. The docs on
> java.com are very difficult to learn from and not much help at all. Is
> there someone who could point me to a simple applicaiton that takes a
> series of BufferedImages and writes a file to disk with them?
>
> Mark McKay
> --
> http://www.kitfox.com
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the body
> of the message "signoff JAVA2D-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".