Nick,
A more appropriate place to ask these questions should be
[EMAIL PROTECTED]
Your particular problem has to do with the input RGBFormat
that needs to be converted to a format that's supported by the
QuickTime file writer. You'll need to query the processor
for the supported formats and set it on the track of the
processor. Something that looks like:
Processor p;
p.configure();
:
// Set the output content descriptor to QuickTime.
p.setContentDescriptor(new ContentDescriptor(FileTypeDescriptor.QUICKTIME));
// Query for the processor for supported formats.
// Then set it on the processor.
TrackControl tcs[] = p.getTrackControls();
Format f[] = tcs[0].getSupportedFormats();
if (f == null || f.length <= 0) {
System.err.println("The mux does not support the input format: " +
tcs[0].getFormat());
return false;
}
tcs[0].setFormat(f[0]);
p.realize();
:
There is also a sample solutions page for JMF on the web:
http://java.sun.com/products/java-media/jmf/2.0/solutions/
Check out the sample on:
"Generating a Movie File from a List of (JPEG) Images"
It may give you some more ideas on solving your problem.
Ivan Wong
Java Media Engineering
Sun Microsystems, Inc.
> Date: Tue, 30 Nov 1999 13:07:46 -0600
> From: Nick Collier <[EMAIL PROTECTED]>
> X-Accept-Language: en
> MIME-Version: 1.0
> To: [EMAIL PROTECTED]
> CC: java2D <[EMAIL PROTECTED]>
> Subject: BufferedImages to Movies using JMF
> Content-Transfer-Encoding: 7bit
>
> Hi,
>
> You were kind enough to reply to my last query about JMF, and so I'm
> sending you another question. If this is inappropriate, please ignore
> this message.
>
> I'm try to creating a quicktime movie (actually any kind of movie, but
> quicktime is the proof of concept) from a series of BufferedImages using
> the Java Media Framework. I'm using the javax.media.util.ImageToBuffer
> class to convert the BufferedImages to convert the Image to a JMF Buffer
> object. I pass these buffer objects to a custom DataSource that pipes
> these buffers to a Processor. My problem seems to arise with the Format
> for the Buffer objects. If I set the Format of the DataSourceStream (a
> PullBufferStream) to the Format associated with the Buffer object
> (RGBFormat, I think) JMF barfs. The entire jmf.log file follows:
>
> H:\JBuilder3\myclasses>less jmf.log
> #
> # JMF Version 2.0
> #
>
> ## Platform: Windows NT, x86, 4.0
> ## Java VM: Sun Microsystems Inc., 1.2.2
>
> $$ Profile: instantiation: 40 ms
>
> ## Processor created: com.sun.media.processor.unknown.Handler@7efe3f
> ## using DataSource: uchicago.src.sim.gui.BufferDataSource@303be0
>
> $$ Profile: parsing: 20 ms
>
> ## Building flow graph for: null
>
> ## Building Track: 0
> ## Input: RGB, 505x505, FrameRate=1.0, Length=256540, 32-bit,
> Masks=16711680:652
> 80:255, LineStride=508, class [I
>
>
> ## Connect to multplexer:
> ## Output content type: video.quicktime
>
> XX Failed to find a multiplexer for the specified output.
> XX Failed to realize: com.sun.media.MediaEngine@bbc5a
> XX Cannot connect the multiplexer
>
> $$ Profile: instantiation: 0 ms
>
> ## Processor created: com.sun.media.processor.unknown.Handler@4743eb
> ## using DataSource: uchicago.src.sim.gui.BufferDataSource@7736bd
>
> $$ Profile: parsing: 0 ms
>
> $$ Profile: instantiation: 0 ms
>
> ## Processor created: com.sun.media.processor.unknown.Handler@12f9ee
> ## using DataSource: uchicago.src.sim.gui.BufferDataSource@3ae941
>
> $$ Profile: parsing: 0 ms
>
> ## Building flow graph for: null
>
> ## Building Track: 0
> ## Input: RGB, 505x505, FrameRate=1.0, Length=256540, 32-bit,
> Masks=16711680:652
> 80:255, LineStride=508, class [I
>
>
> ## Connect to multplexer:
> ## Output content type: video.quicktime
>
> XX Failed to find a multiplexer for the specified output.
> XX Failed to realize: com.sun.media.MediaEngine@5a669c
> XX Cannot connect the multiplexer
>
> My question then is how to set the format so a quicktime movie can be
> generated. If I set the format to say VideoFormat(VideoFormat.JPEG...)
> then DataSourceStream.read(Buffer buf) has problems. The Buffers
> converted from Images contain int[] as data while the passed Buffer
> seems to expect byte[] (I'm assuming because of the format). Needless to
> say I'm a bit confused, so any help is appreciated.
>
> By the way, I'm basing some of my code on the JpegImagesToMovie example,
> and while this seems to work (i.e. no error messages and the jmf.log
> seems okay) when I try to play the resulting movie with the latest
> QuickTime player I can't an error message telling me it can't open the
> movie. So perhaps, something is broken with JMF quicktime.
>
> thanks,
>
> Nick
>
>
> --
>
> Nick Collier
> [EMAIL PROTECTED]
> Social Science Research Computing
> University of Chicago
> Chicago, IL 60637
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".