|
Copyright 2012-04-26 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.monte.media.avi.AbstractAVIStream
org.monte.media.avi.AVIOutputStream
org.monte.media.avi.AVIWriter
public class AVIWriter
Provides high-level support for encoding and writing audio and video samples into an AVI 1.0 file.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.monte.media.avi.AVIOutputStream |
|---|
AVIOutputStream.States |
| Nested classes/interfaces inherited from class org.monte.media.avi.AbstractAVIStream |
|---|
AbstractAVIStream.AudioTrack, AbstractAVIStream.AVIMediaType, AbstractAVIStream.Chunk, AbstractAVIStream.CompositeChunk, AbstractAVIStream.DataChunk, AbstractAVIStream.FixedSizeDataChunk, AbstractAVIStream.MainHeader, AbstractAVIStream.MidiTrack, AbstractAVIStream.Sample, AbstractAVIStream.TextTrack, AbstractAVIStream.Track, AbstractAVIStream.VideoTrack |
| Field Summary | |
|---|---|
static Format |
AVI
|
static Format |
VIDEO_JPEG
|
static Format |
VIDEO_PNG
|
static Format |
VIDEO_RAW
|
static Format |
VIDEO_RLE
|
static Format |
VIDEO_SCREEN_CAPTURE
|
| Fields inherited from class org.monte.media.avi.AVIOutputStream |
|---|
aviChunk, avihChunk, moviChunk, state |
| Fields inherited from class org.monte.media.avi.AbstractAVIStream |
|---|
AVI_ID, AVIH_FLAG_COPYRIGHTED, AVIH_FLAG_HAS_INDEX, AVIH_FLAG_IS_INTERLEAVED, AVIH_FLAG_MUST_USE_INDEX, AVIH_FLAG_TRUST_CK_TYPE, AVIH_FLAG_WAS_CAPTURE_FILE, AVIH_ID, HDRL_ID, IDX1_ID, LIST_ID, MOVI_ID, out, REC_ID, STRD_ID, streamOffset, STRF_ID, STRH_FLAG_DISABLED, STRH_FLAG_VIDEO_PALETTE_CHANGES, STRH_ID, STRL_ID, STRN_ID, tracks |
| Constructor Summary | |
|---|---|
AVIWriter(java.io.File file)
Creates a new AVI writer. |
|
AVIWriter(javax.imageio.stream.ImageOutputStream out)
Creates a new AVI writer. |
|
| Method Summary | |
|---|---|
int |
addTrack(Format format)
Adds a track. |
Codec |
getCodec(int track)
Returns the codec of the specified track. |
Rational |
getDuration(int track)
Returns the media duration of the track in seconds. |
Format |
getFileFormat()
Returns the file format. |
Format |
getFormat(int track)
Returns the media format of the specified track. |
int |
getTrackCount()
Returns the number of tracks. |
boolean |
isVFRSupported()
|
void |
setCodec(int track,
Codec codec)
Sets the codec for the specified track. |
void |
write(int track,
Buffer buf)
Encodes the data provided in the buffer and then writes it into the specified track. |
void |
write(int track,
java.awt.image.BufferedImage image,
long duration)
Encodes the provided image and writes its sample data into the specified track. |
| Methods inherited from class org.monte.media.avi.AVIOutputStream |
|---|
addAudioTrack, addVideoTrack, close, ensureFinished, ensureStarted, finish, getExtraHeaderFourCCs, getMediaDuration, getVideoDimension, isDataLimitReached, putExtraHeader, setName, setPalette, writePalette, writeSample, writeSample, writeSample, writeSamples |
| Methods inherited from class org.monte.media.avi.AbstractAVIStream |
|---|
getRelativeStreamPosition, intToType, isFlagSet, seekRelative, typeToInt |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.monte.media.MovieWriter |
|---|
close, isDataLimitReached |
| Field Detail |
|---|
public static final Format AVI
public static final Format VIDEO_RAW
public static final Format VIDEO_JPEG
public static final Format VIDEO_PNG
public static final Format VIDEO_RLE
public static final Format VIDEO_SCREEN_CAPTURE
| Constructor Detail |
|---|
public AVIWriter(java.io.File file)
throws java.io.IOException
file - the output file
java.io.IOException
public AVIWriter(javax.imageio.stream.ImageOutputStream out)
throws java.io.IOException
out - the output stream.
java.io.IOException| Method Detail |
|---|
public Format getFileFormat()
throws java.io.IOException
MovieWriter
getFileFormat in interface MovieWriterjava.io.IOExceptionpublic Format getFormat(int track)
MovieWriterMovieWriter.addTrack(org.monte.media.Format).
getFormat in interface MovieWritertrack - Track number.
public Rational getDuration(int track)
getDuration in interface MovieWriter
public int addTrack(Format format)
throws java.io.IOException
addTrack in interface MovieWriterformat - The format of the track.
java.io.IOExceptionpublic Codec getCodec(int track)
public void setCodec(int track,
Codec codec)
public int getTrackCount()
MovieWriter
getTrackCount in interface MovieWriter
public void write(int track,
java.awt.image.BufferedImage image,
long duration)
throws java.io.IOException
track - The track index.image - The image of the video frame.duration - Duration given in media time units.
IndexOutofBoundsException - if the track index is out of bounds.
if - the duration is less than 1, or if the dimension of the frame
does not match the dimension of the video.
java.lang.UnsupportedOperationException - if the MovieWriter does not have
a built-in encoder for this video format.
java.io.IOException - if writing the sample data failed.
public void write(int track,
Buffer buf)
throws java.io.IOException
Does nothing if the discard-flag in the buffer is set to true.
write in interface MovieWriterwrite in interface Multiplexertrack - The track number.buf - The buffer containing a data sample.
java.io.IOExceptionpublic boolean isVFRSupported()
|
Copyright 2012-04-26 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||