st377-1
SMPTE ST 377-1:2019 "Material Exchange Format (MXF) — File Format
Specification": KLV (Key-Length-Value) framing, the Partition Pack, the
Primer Pack, and the four Root Metadata Sets every MXF file has, no_std.
This is the first file-based-interchange crate in the workspace — every other crate here is live-stream-shaped.
- [
KlvItem] — the generic KLV triplet (§6.3) everything else in an MXF file rides on; [walk_klv_items]/[collect_klv_items] walk a sequence. - [
PartitionPack] — the Header/Body/Footer Partition Pack (§7.1-§7.4, Tables 4-8): [PartitionKind] + [PartitionStatus] plus every Table 5 field (KAG size, byte offsets, Operational Pattern UL, Essence Container UL batch). - [
PrimerPack] — the per-Partition local-tag → UL/UUID lookup table (§9.2). - [
LocalSet] — the generic "local set" KLV-lite framing (§9.3) every Header Metadata Set uses; [StructuralSetKind] identifies which Set a given instance is (Table 17) even for Sets this crate doesn't deeply type. - [
Preface], [Identification], [ContentStorage], [EssenceContainerData] — the four Root Metadata Sets (Annex A) every real MXF file has, decoded field-by-field. - [
RandomIndexPack] — the optional file-trailer Partition index (§12).
See docs/st377-1.md for the curated ST 377-1 transcription this crate
implements field-for-field, including this crate's scope decision (what's
fully typed vs. identified-but-generic, with spec citations for each call).
Scope
MXF is a huge ecosystem spec: Operational Patterns, Essence Container
mappings, DM/Application Metadata plug-ins, and per-essence-kind Descriptors
all live in sibling documents this crate does not anticipate. This first
pass fully types the format's own backbone (KLV/BER framing, the
Partition Pack, the Primer Pack, "local set" framing) and the four Root
Metadata Sets every real file has; everything else (Packages, Tracks,
Sequences, Descriptors, DM/Application Metadata) is identified but
generic — parsed as a [LocalSet] tagged with its [StructuralSetKind],
preserved byte-for-byte, not individually decoded. Essence Container
payload bytes are out of scope entirely — carried opaquely via
[KlvItem], never decoded, the same boundary as st337's burst_payload/
rdd29's AudioDataDLC.
#![no_std] + alloc; depends only on broadcast-common.
Quick start
use ;
use ;
let pack = PartitionPack ;
let bytes = pack.to_bytes;
assert_eq!;
Examples
Features
| Feature | Default | Description |
|---|---|---|
std |
yes | Link the standard library. Without it the crate is #![no_std] + alloc. |
serde |
no | serde::Serialize/Deserialize derives on public types. |
Minimum Supported Rust Version
1.86
License
MIT OR Apache-2.0