Skip to main content

Crate vsd_mp4

Crate vsd_mp4 

Source
Expand description

This crate contains an MP4 parser ported from the shaka-player project.

It also includes optional features for decryption, parsing subtitles, and processing PSSH and SIDX boxes.

§Optional Features

The following Cargo features can be enabled or disabled (all features are enabled by default):

FeatureDescription
decrypt-cencEnables support for Common Encryption (CENC) scheme decryption.
decrypt-hlsEnables support for HTTP Live Streaming (HLS) segment decryption.
psshEnables support for parsing Protection System Specific Header (PSSH) boxes.
sidxEnables support for parsing Segment Index (SIDX) boxes.
sub-ttmlEnables support for extracting subtitles from STPP boxes.
sub-vttEnables support for extracting subtitles from WVTT boxes.

Modules§

boxes
MP4 box structures and parsers.
decryptdecrypt-cenc or decrypt-hls
Decryption utilities for protected MP4 and HLS streams.
psshpssh
MP4 protection system-specific header (PSSH) box parsing.
subsub-ttml or sub-vtt
Subtitle extraction and parsing utilities for MP4 streams.

Macros§

bail
Early-returns with an Error::Other variant.
data
Helper macro to create a reference-counted, interior-mutable Option cell.

Structs§

Mp4Parser
A parser for extracting structure and metadata from MP4 files.
ParsedBox
A representation of a parsed MP4 box containing its header information and payload reader.
Reader
A reader for parsing binary data of MP4 containers with support for big-endian and little-endian formats.

Enums§

BoxType
The format type of an MP4 box.
Error
The error type returned by functions in vsd-mp4.

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§

Result
A specialized Result type for operations that can fail in vsd-mp4.