Crate vsd_mp4

Source
Expand description

This crate contains a mp4 parser ported from shaka-player project. Also, some optional features are added for parsing subtitles, PSSH and SIDX boxes.

§Optional Features

The following are a list of Cargo features that can be enabled or disabled:

  • pssh: Enables support for parsing PSSH boxes.
  • sidx: Enables support for parsing SIDX boxes.
  • text-ttml: Enables support for extracting ttml subtitles.
  • text-vtt: Enables support for extracting vtt subtitles.

Modules§

psshpssh
Mp4 PSSH box parser.
sidxsidx
Mp4 SIDX box parser.
texttext-ttml or text-vtt
Mp4 parsers related to some subtitles text processing.

Structs§

Error
The returned error type.
Mp4Parser
Mp4 file parser.
ParsedBox
Parsed mp4 box.
Reader
Reader for parsing mp4 files.

Enums§

BoxType
An enum used to track the type of box so that the correct values can be read from the header.
ErrorType
The type of error which can occur during parsing data.

Functions§

alldata
Create a callback that tells the Mp4 parser to treat the body of a box as a binary blob and to parse the body’s contents using the provided callback.
audio_sample_entry
A callback that tells the Mp4 parser to treat the body of a box as a audio sample entry. A audio sample entry has some fixed-sized fields describing the audio codec parameters, followed by an arbitrary number of ppended children. Each child is a box.
children
A callback that tells the Mp4 parser to treat the body of a box as a series of boxes. The number of boxes is limited by the size of the parent box.
sample_description
A callback that tells the Mp4 parser to treat the body of a box as a sample description. A sample description box has a fixed number of children. The number of children is represented by a 4 byte unsigned integer. Each child is a box.
type_from_string
Convert an ascii string name to the integer type for a box. The name must be four characters long.
type_to_string
Convert an integer type from a box into an ascii string name. Useful for debugging.
visual_sample_entry
A callback that tells the Mp4 parser to treat the body of a box as a visual sample entry. A visual sample entry has some fixed-sized fields describing the video codec parameters, followed by an arbitrary number of appended children. Each child is a box.

Type Aliases§

CallbackType
Callback type for parsing an mp4 file.
HandlerResult
Result type returned when parsing an mp4 file.
Result
A Result alias where the Err case is vsd_mp4::Error.