public class AVIWriter extends AVIOutputStream implements MovieWriter
AVIOutputStream.StatesAbstractAVIStream.AudioTrack, AbstractAVIStream.AVIMediaType, AbstractAVIStream.Chunk, AbstractAVIStream.CompositeChunk, AbstractAVIStream.DataChunk, AbstractAVIStream.FixedSizeDataChunk, AbstractAVIStream.MainHeader, AbstractAVIStream.MidiTrack, AbstractAVIStream.Sample, AbstractAVIStream.TextTrack, AbstractAVIStream.Track, AbstractAVIStream.VideoTrack| Modifier and Type | Field and Description |
|---|---|
static Format |
AVI |
static Format |
VIDEO_JPEG |
static Format |
VIDEO_PNG |
static Format |
VIDEO_RAW |
static Format |
VIDEO_RLE |
static Format |
VIDEO_SCREEN_CAPTURE |
aviChunk, avihChunk, moviChunk, stateAVI_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, AVIX_ID, CHUNK_SUBTYPE_MASK, DB_ID, DC_ID, HDRL_ID, IDX1_ID, LIST_ID, MOVI_ID, out, PC_ID, REC_ID, RIFF_ID, STRD_ID, streamOffset, STRF_ID, STRH_FLAG_DISABLED, STRH_FLAG_VIDEO_PALETTE_CHANGES, STRH_ID, STRL_ID, STRN_ID, tracks, WB_ID| Constructor and Description |
|---|
AVIWriter(File file)
Creates a new AVI writer.
|
AVIWriter(ImageOutputStream out)
Creates a new AVI writer.
|
| Modifier and Type | Method and Description |
|---|---|
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 |
isEmpty(int track)
Returns true if the specified track has no samples.
|
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,
BufferedImage image,
long duration)
Encodes the provided image and writes its sample data into the specified
track.
|
addAudioTrack, addVideoTrack, close, ensureFinished, ensureStarted, finish, getCompressionQuality, getExtraHeaderFourCCs, getMediaDuration, getVideoDimension, isDataLimitReached, putExtraHeader, setCompressionQuality, setName, setPalette, writePalette, writeSample, writeSample, writeSample, writeSamplesgetRelativeStreamPosition, intToType, isFlagSet, seekRelative, typeToIntclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, isDataLimitReachedpublic 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
public AVIWriter(File file) throws IOException
file - the output fileIOExceptionpublic AVIWriter(ImageOutputStream out) throws IOException
out - the output stream.IOExceptionpublic Format getFileFormat() throws IOException
MovieWritergetFileFormat in interface MovieWriterIOExceptionpublic Format getFormat(int track)
MovieWriterMovieWriter.addTrack(org.monte.media.Format).getFormat in interface MovieWritertrack - Track number.public Rational getDuration(int track)
getDuration in interface MovieWriterpublic int addTrack(Format format) throws IOException
addTrack in interface MovieWriterformat - The format of the track.IOExceptionpublic Codec getCodec(int track)
public void setCodec(int track,
Codec codec)
public int getTrackCount()
MovieWritergetTrackCount in interface MovieWriterpublic void write(int track,
BufferedImage image,
long duration)
throws 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.UnsupportedOperationException - if the MovieWriter does not
have a built-in encoder for this video format.IOException - if writing the sample data failed.public void write(int track,
Buffer buf)
throws 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.IOExceptionpublic boolean isVFRSupported()
public boolean isEmpty(int track)
MovieWriterisEmpty in interface MovieWriterCopyright © 2014. All Rights Reserved.