The MP4Container is the central class for the MP4 demultiplexer. It reads the
container and gives access to the containing data.
The data source can be either an
InputStream
or a
RandomAccessFile
. Since the specification does not decree a
specific order of the content, the data needed for parsing (the sample
tables) may be at the end of the stream. In this case, random access is
needed and reading from an
InputSteam
will cause an exception.
Thus, whenever possible, a
RandomAccessFile
should be used for
local files. Parsing from an
InputStream
is useful when reading
from a network stream.
Each
MP4Container
can return the used file brand (file format
version). Optionally, the following data may be present:
- progressive download informations: pairs of download rate and playback
delay, see
getDownloadInformationPairs()
- a
Movie
Additionally it gives access to the underlying MP4 boxes, that can be
retrieved by
getBoxes()
. However, it is not recommended to
access the boxes directly.