|
Copyright 2011-01-06 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.randelshofer.media.quicktime.QuickTimeOutputStream
QuickTimeWriter instead of this class.
@Deprecated public class QuickTimeOutputStream
Supports writing of images into a QuickTime movie file.
The images are written as video frames.
Video frames can be encoded with the RAW, the JPG or the PNG video format. All frames must have the same format. When JPG is used each frame can have an individual encoding quality.
Each frame in a QuickTime file can have an individual duration. The duration
is based on time scale units, which can be specified using method
setTimeScale(int).
For detailed information about the QuickTime file format see: http://developer.apple.com/documentation/QuickTime/QTFF/
| Nested Class Summary | |
|---|---|
static class |
QuickTimeOutputStream.VideoFormat
Deprecated. Supported video formats. |
| Constructor Summary | |
|---|---|
QuickTimeOutputStream(java.io.File file,
QuickTimeOutputStream.VideoFormat format)
Deprecated. Creates a new QuickTime file with the specified video format. |
|
QuickTimeOutputStream(javax.imageio.stream.ImageOutputStream out,
QuickTimeOutputStream.VideoFormat format)
Deprecated. Creates a new QuickTime output stream with the specified video format. |
|
| Method Summary | |
|---|---|
void |
close()
Deprecated. Closes the movie file as well as the stream being filtered. |
void |
finish()
Deprecated. Finishes writing the contents of the QuickTime output stream without closing the underlying stream. |
int |
getTimeScale()
Deprecated. Returns the time scale of this media. |
float |
getVideoCompressionQuality()
Deprecated. Returns the video compression quality. |
java.awt.Dimension |
getVideoDimension()
Deprecated. Gets the dimension of the video track. |
void |
setTimeScale(int newValue)
Deprecated. Sets the time scale for this media, that is, the number of time units that pass per second in its time coordinate system. |
void |
setVideoCompressionQuality(float newValue)
Deprecated. Sets the compression quality of the video track. |
void |
setVideoDimension(int width,
int height)
Deprecated. Sets the dimension of the video track. |
void |
writeFrame(java.awt.image.BufferedImage image,
int duration)
Deprecated. Writes a frame to the video track. |
void |
writeFrame(java.io.File file,
int duration)
Deprecated. Writes a frame from a file to the video track. |
void |
writeFrame(java.io.InputStream in,
int duration)
Deprecated. Writes a frame to the video track. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public QuickTimeOutputStream(java.io.File file,
QuickTimeOutputStream.VideoFormat format)
throws java.io.IOException
file - the output fileformat - Selects an encoder for the video format.
java.lang.IllegalArgumentException - if format is null.
java.io.IOException
public QuickTimeOutputStream(javax.imageio.stream.ImageOutputStream out,
QuickTimeOutputStream.VideoFormat format)
throws java.io.IOException
out - the underlying output stream.format - Selects an encoder for the video format.
java.lang.IllegalArgumentException - if format is null.
java.io.IOException| Method Detail |
|---|
public void setTimeScale(int newValue)
The default value is 600.
newValue - public int getTimeScale()
public void setVideoCompressionQuality(float newValue)
Changing this value affects frames which are subsequently written to the QuickTimeOutputStream. Frames which have already been written are not changed.
This value has no effect on videos encoded with the PNG format.
The default value is 0.95.
newValue - public float getVideoCompressionQuality()
public void setVideoDimension(int width,
int height)
You need to explicitly set the dimension, if you add all frames from files or input streams.
If you add frames from buffered images, then QuickTimeOutputStream can determine the video dimension from the image width and height.
width - Must be greater than 0.height - Must be greater than 0.public java.awt.Dimension getVideoDimension()
Returns null if the dimension is not known.
public void writeFrame(java.awt.image.BufferedImage image,
int duration)
throws java.io.IOException
If the dimension of the video track has not been specified yet, it is derived from the first buffered image added to the QuickTimeOutputStream.
image - The frame image.duration - The duration of the frame in time scale units.
java.lang.IllegalArgumentException - if the duration is less than 1, or
if the dimension of the frame does not match the dimension of the video
track.
java.io.IOException - if writing the data sample failed.
public void writeFrame(java.io.File file,
int duration)
throws java.io.IOException
This method does not inspect the contents of the file. The contents has to match the video format. For example, it is your responsibility to only add JPG files if you have chosen the JPEG video format.
If you add all frames from files or from input streams, then you have to explicitly set the dimension of the video track before you call finish() or close().
file - The file which holds the image data.duration - The duration of the frame in time scale units.
java.lang.IllegalArgumentException - if the duration is less than 1.
java.io.IOException - if writing the data sample failed.
public void writeFrame(java.io.InputStream in,
int duration)
throws java.io.IOException
This method does not inspect the contents of the input stream. The contents has to match the video format. For example, it is your responsibility to only add JPG files if you have chosen the JPEG video format.
If you add all frames from files or from input streams, then you have to explicitly set the dimension of the video track before you call finish() or close().
in - The input stream which holds the image data.duration - The duration of the frame in time scale units.
java.lang.IllegalArgumentException - if the duration is less than 1.
java.io.IOException - if writing the image failed.
public void close()
throws java.io.IOException
java.io.IOException - if an I/O error has occurred
public void finish()
throws java.io.IOException
java.lang.IllegalStateException - if the dimension of the video track
has not been specified or determined yet.
java.io.IOException - if an I/O exception has occurred
|
Copyright 2011-01-06 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||