public class AVIReader extends AVIInputStream implements MovieReader
AbstractAVIStream.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 |
idx1, in, mainHeaderAVI_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 |
|---|
AVIReader(java.io.File file) |
AVIReader(javax.imageio.stream.ImageInputStream in) |
| Modifier and Type | Method and Description |
|---|---|
int |
findTrack(int fromTrack,
Format format)
Finds a track with the specified format.
|
Rational |
getDuration()
Returns the total duration of the movie .
|
Rational |
getDuration(int track)
Returns the duration of the specified track.
|
Format |
getFileFormat()
Returns the file format.
|
Format |
getFormat(int track)
Returns the media format of the specified track.
|
Rational |
getReadTime(int track)
Returns the current time of the track.
|
long |
getTimeScale(int track)
Returns the time scale of the specified track.
|
int |
nextTrack()
Returns the index of the next track in playback sequence.
|
void |
read(int track,
Buffer buffer)
Reads a chunk of media data from the specified track.
|
java.awt.image.BufferedImage |
read(int track,
java.awt.image.BufferedImage img)
Reads an image.
|
Rational |
sampleToTime(int track,
long sampleIndex)
Returns the time for the specified sample number.
|
void |
setMovieReadTime(Rational newValue)
Sets the read time of all tracks to the closest sync sample before or
at the specified time.
|
long |
timeToSample(int track,
Rational time)
Returns the sample number for the specified time.
|
close, ensureRealized, getChunkCount, getExtraHeader, getExtraHeaderFourCCs, getHeaderFlags, getMicroSecPerFrame, getName, getStartTime, getTrackCount, getVideoDimension, readAllMetadatagetRelativeStreamPosition, intToType, isFlagSet, seekRelative, typeToIntclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, getChunkCount, getTrackCountpublic static final Format AVI
public AVIReader(javax.imageio.stream.ImageInputStream in)
throws java.io.IOException
java.io.IOExceptionpublic AVIReader(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic Format getFileFormat() throws java.io.IOException
MovieReadergetFileFormat in interface MovieReaderjava.io.IOExceptionpublic Format getFormat(int track) throws java.io.IOException
MovieReadergetFormat in interface MovieReadertrack - Track number.java.io.IOExceptionpublic void read(int track,
Buffer buffer)
throws java.io.IOException
If the track is a video track with palette change "..PC" chunks, then the body of the palette change chunk can be found in the buffer.header.
read in interface MovieReadertrack - The track number.buffer - The buffer for the media data.java.io.IOExceptionpublic java.awt.image.BufferedImage read(int track,
java.awt.image.BufferedImage img)
throws java.io.IOException
track - The track numberimg - An image that can be reused if it fits the media format of the
track. Pass null to create a new image on each read.java.io.IOExceptionpublic Rational getReadTime(int track) throws java.io.IOException
MovieReadergetReadTime in interface MovieReaderjava.io.IOExceptionpublic int nextTrack()
throws java.io.IOException
MovieReadernextTrack in interface MovieReaderjava.io.IOExceptionpublic Rational getDuration()
MovieReadergetDuration in interface MovieReaderpublic Rational getDuration(int track)
MovieReadergetDuration in interface MovieReaderpublic long getTimeScale(int track)
AVIInputStreamgetTimeScale in class AVIInputStreampublic long timeToSample(int track,
Rational time)
MovieReadertimeToSample in interface MovieReaderpublic Rational sampleToTime(int track, long sampleIndex) throws java.io.IOException
MovieReadersampleToTime in interface MovieReaderjava.io.IOExceptionpublic void setMovieReadTime(Rational newValue) throws java.io.IOException
MovieReadersetMovieReadTime in interface MovieReadernewValue - Time in seconds.java.io.IOExceptionpublic int findTrack(int fromTrack,
Format format)
throws java.io.IOException
MovieReaderfindTrack in interface MovieReaderfromTrack - the start track number.format - A format specification.java.io.IOException