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
PSSHboxes. - sidx: Enables support for parsing
SIDXboxes. - text-ttml: Enables support for extracting ttml subtitles.
- text-vtt: Enables support for extracting vtt subtitles.
Modules§
- pssh
pssh - Mp4
PSSHbox parser. - sidx
sidx - Mp4
SIDXbox parser. - text
text-ttmlortext-vtt - Mp4 parsers related to some subtitles text processing.
Structs§
- Error
- The returned error type.
- Mp4Parser
- Mp4 file parser.
- Parsed
Box - 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.
- Error
Type - 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§
- Callback
Type - Callback type for parsing an mp4 file.
- Handler
Result Resulttype returned when parsing an mp4 file.- Result
- A
Resultalias where theErrcase isvsd_mp4::Error.