public class AVIInputStream extends AbstractAVIStream
The length of an AVI 1.0 file is limited to 1 GB. This class supports lengths of up to 4 GB, but such files may not work on all players.
Support for AVI 2.0 file is incomplete. This class currently ignores the extended index chunks. Instead all chunks in the "movi" list are scanned. With scanning, the reader is not able to distinguish between keyframes and non-keyframes. As a consequence opening an AVI 2.0 file is very slow, and decoding of frames may fail.
For detailed information about the AVI 1.0 file format see:
msdn.microsoft.com AVI RIFF
www.microsoft.com FOURCC for Video Compression
www.saettler.com RIFF
For detailed information about the AVI 2.0 file format see:
OpenDML AVI File Format Extensions, Version 1.02
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 |
|---|---|
protected ArrayList<AbstractAVIStream.Sample> |
idx1 |
protected ImageInputStream |
in
The image input stream.
|
protected AbstractAVIStream.MainHeader |
mainHeader |
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, 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 |
|---|
AVIInputStream(File file)
Creates a new instance.
|
AVIInputStream(ImageInputStream in)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
ensureRealized()
Ensures that all meta-data has been read from the file.
|
long |
getChunkCount(int track)
Returns the number of media data chunks in the track.
|
byte[] |
getExtraHeader(int track,
String fourcc)
Returns the contents of the extra track header.
|
String[] |
getExtraHeaderFourCCs(int track)
Returns the fourcc's of all extra stream headers.
|
int |
getHeaderFlags()
Returns the main header flags.
|
long |
getMicroSecPerFrame()
Returns the number of microseconds (10^-6 seconds) per frame.
|
String |
getName(int track)
Returns the name of the track, or null if the name is not specified.
|
long |
getStartTime(int track)
Returns the start time of the track given as the number of frames in
microSecPerFrame units.
|
long |
getTimeScale(int track)
Returns the time scale of the specified track.
|
int |
getTrackCount() |
Dimension |
getVideoDimension() |
protected void |
readAllMetadata()
Reads all metadata of the file.
|
getRelativeStreamPosition, intToType, isFlagSet, seekRelative, typeToIntprotected final ImageInputStream in
protected AbstractAVIStream.MainHeader mainHeader
protected ArrayList<AbstractAVIStream.Sample> idx1
public AVIInputStream(File file) throws IOException
file - the input fileIOExceptionpublic AVIInputStream(ImageInputStream in) throws IOException
in - the input stream.IOExceptionprotected void ensureRealized()
throws IOException
IOExceptionpublic int getHeaderFlags()
throws IOException
AVIH_... values.IOExceptionpublic Dimension getVideoDimension() throws IOException
IOExceptionpublic int getTrackCount()
throws IOException
IOExceptionpublic long getMicroSecPerFrame()
throws IOException
IOExceptionpublic long getTimeScale(int track)
throws IOException
IOExceptionpublic long getStartTime(int track)
throws IOException
IOExceptionpublic long getChunkCount(int track)
throws IOException
track - IOExceptionpublic String getName(int track) throws IOException
IOExceptionpublic byte[] getExtraHeader(int track,
String fourcc)
throws IOException
track - fourcc - IOExceptionpublic String[] getExtraHeaderFourCCs(int track) throws IOException
track - IOExceptionprotected void readAllMetadata()
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionCopyright © 2014. All Rights Reserved.