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 and PSSH boxes.

Optional Features

The following are a list of [Cargo features][cargo-features] that can be enabled or disabled:

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

Modules

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

Structs

Enums

  • An enum used to track the type of box so that the correct values can be read from the header.

Functions

  • 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.
  • 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.
  • 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.
  • Convert an ascii string name to the integer type for a box. The name must be four characters long.
  • Convert an integer type from a box into an ascii string name. Useful for debugging.
  • 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 Definitions

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