Crate mp4parse

Source
Expand description

Module for parsing ISO Base Media Format aka video/mp4 streams.

Structs§

ALACSpecificBox
Represent an ALACSpecificBox ‘alac’
AV1ConfigBox
See AV1-ISOBMFF § 2.3.3
AudioSampleEntry
AuxiliaryTypeProperty
See HEIF (ISO 23008-12:2017) § 6.5.8
AvifContext
ChunkOffsetBox
CompositionOffsetBox
ES_Descriptor
An Elementary Stream Descriptor See MPEG-4 Systems (ISO 14496-1:2010) § 7.2.6.5
FLACMetadataBlock
FLACSpecificBox
Represents a FLACSpecificBox ‘dfLa’
IccColourInformation
The raw bytes of the ICC profile
ImageSpatialExtentsProperty
ItemPropertiesBox
See ISOBMFF (ISO 14496-12:2020) § 8.11.14.1
Matrix
MediaContext
Internal data structures.
MediaScaledTime
A time to be scaled by the media’s global (mvhd) timescale.
MediaTimeScale
The media’s global (mvhd) timescale in units per second.
MetadataBox
Represents the contents of ‘ilst’ atoms within a metadata box ‘meta’, parsed as iTunes metadata using the conventional tags.
MovieExtendsBox
NclxColourInformation
Despite Rec. ITU-T H.273 (12/2016) defining the CICP fields as having a range of 0-255, and only a small fraction of those values being used, ISOBMFF (ISO 14496-12:2020) § 12.1.5 defines them as 16-bit values in the colr box. Since we have no use for the additional range, and it would complicate matters later, we fallibly convert before storing the input.
OpusSpecificBox
Represent an OpusSpecificBox ‘dOps’
PixelAspectRatio
PixelInformation
ProtectionSchemeInfoBox
ProtectionSystemSpecificHeaderBox
Sample
SampleDescriptionBox
SampleSizeBox
SampleToChunk
SampleToChunkBox
SchemeTypeBox
SyncSampleBox
TimeOffset
TimeToSampleBox
Track
TrackEncryptionBox
TrackHeaderBox
Track header box ‘tkhd’
TrackReference
TrackReferenceBox
TrackScaledTime
A time to be scaled by the track’s local (mdhd) timescale. Members are time in scale units and the track id.
TrackTimeScale
The track’s local (mdhd) timescale. Members are timescale units per second and the track id.
UnsupportedFeatures
A collection to indicate unsupported features that were encountered during parsing. Since the default behavior for many such features is to ignore them, this often not fatal and there may be several to report.
UserdataBox
Represents a userdata box ‘udta’. Currently, only the metadata atom ‘meta’ is parsed.
VPxConfigBox
Represent a Video Partition Codec Configuration ‘vpcC’ box (aka vp9). The meaning of each field is covered in detail in “VP Codec ISO Media File Format Binding”.
VideoSampleEntry

Enums§

AdvisoryRating
Represents the parental advisory rating on the track, stored within the ‘rtng’ atom.
AudioCodecSpecific
CodecType
ColourInformation
Error
Describes parser failures.
Feature
Genre
Represents possible contents of the ©gen or gnre atoms within a metadata box. ‘udta.meta.ilst’ may only have either a standard genre box ‘gnre’ or a custom genre box ‘©gen’, but never both at once.
ImageMirror
The axis about which the image is mirrored (opposite of flip) Visualized in terms of starting with (⥠) UPWARDS HARPOON WITH BARB LEFT FROM BAR similar to a DIGIT ONE (1)
ImageRotation
Rotation in the positive (that is, anticlockwise) direction Visualized in terms of starting with (⥠) UPWARDS HARPOON WITH BARB LEFT FROM BAR similar to a DIGIT ONE (1)
ItemProperty
See ISOBMFF (ISO 14496-12:2020) § 8.11.14.1 Variants with no associated data are recognized but not necessarily supported. See Feature to determine support.
MediaType
Represents the contents of a ‘stik’ atom that indicates content types within iTunes.
ParseStrictness
SampleEntry
Status
The return value to the C API Any detail that needs to be communicated to the caller must be encoded here since the Error type’s associated data is part of the FFI.
TimeOffsetVersion
TrackReferenceEntry
TrackType
VideoCodecSpecific

Constants§

AVIF_BRAND
The brand to identify AV1 image items The ‘avif’ brand indicates structural requirements on files See https://aomediacodec.github.io/av1-avif/#image-and-image-collection-brand
AVIS_BRAND
The brand to identify AVIF image sequences The ‘avis’ brand indicates structural requirements on files See https://aomediacodec.github.io/av1-avif/#image-and-image-collection-brand
MIF1_BRAND
The HEIF image and image collection brand The ‘mif1’ brand indicates structural requirements on files See HEIF (ISO 23008-12:2017) § 10.2.1
MSF1_BRAND
The HEIF image sequence brand The ‘msf1’ brand indicates structural requirements on files See HEIF (ISO 23008-12:2017) § 10.3.1

Traits§

ToUsize
A trait to indicate a type can be infallibly converted to usize. This should only be implemented for infallible conversions, so only unsigned types are valid.

Functions§

read_avif
Read the contents of an AVIF file
read_mp4
Read the contents of a box, including sub boxes.
serialize_opus_header
Re-serialize the Opus codec-specific config data as an OpusHead packet.

Type Aliases§

ByteData
Result
Result shorthand using our Error enum.
TryBox
TryHashMap
TryString
TryVec