January 2005
Intermediate to advanced
256 pages
6h 34m
English
One of the most
obviously useful components is the
MovieExporter, which you can use to convert a
QuickTime movie into a non-QuickTime format, such as AVI or MPEG-4.
The quicktime.std.qtcomponents.MovieExporter
class provides a convenient Java wrapper around
movie exporter components. It requires that you pass it a subtype
indicating which exporter you want—i.e., which format you want
to export to. Example 4-2 shows how a
MovieExporter can be created and used from a
canned list of subtypes.
Compile and run this example with ant run-ch04-simplemovieexport.
Example 4-2. Simple MovieExporter creation and use
package com.oreilly.qtjnotebook.ch04; import quicktime.*; import quicktime.std.*; import quicktime.std.movies.*; import quicktime.io.*; import quicktime.std.qtcomponents.*; import quicktime.utils.QTUtils; import java.awt.*; import javax.swing.*; import com.oreilly.qtjnotebook.ch01.QTSessionCheck; public class SimpleMovieExport extends Object { public static final void main (String[ ] args) { new SimpleMovieExport( ); } public SimpleMovieExport( ) { // build choices ExportChoice[ ] choices = new ExportChoice[3]; choices[0] = new ExportChoice ("QuickTime Movie", StdQTConstants.kQTFileTypeMovie); choices[1] = new ExportChoice ("AVI file", StdQTConstants.kQTFileTypeAVI); choices[2] = new ExportChoice ("MPEG-4 file", QTUtils.toOSType("mpg4")); try { // query user for a movie to open QTSessionCheck.check( ); QTFile file = QTFile.standardGetFilePreview ...Read now
Unlock full access