Crate mp4box

Crate mp4box 

Source
Expand description

mp4box

A minimal, dependency-light MP4/ISOBMFF parser for Rust.

This crate parses the MP4 box tree (including 64-bit “large” boxes and UUID boxes), classifies known box types, and lets you attach custom decoders to interpret payloads.

Typical use cases:

  • CLIs for inspecting MP4 structure (e.g. mp4dump)
  • Tauri / desktop tools that need JSON output for UI
  • Backend services that need to inspect or validate MP4 files.

§Quick start

use mp4box::analyze_file;

fn main() -> anyhow::Result<()> {
    let boxes = analyze_file("video.mp4", /*decode=*/ false)?;
    println!("Top-level boxes: {}", boxes.len());
    Ok(())
}

For a more advanced example, see the mp4dump binary in this repository.

Re-exports§

pub use boxes::BoxHeader;
pub use boxes::BoxKey;
pub use boxes::BoxRef;
pub use boxes::FourCC;
pub use boxes::NodeKind;
pub use json_api::HexDump;
pub use json_api::JsonBox;
pub use json_api::analyze_file;
pub use json_api::hex_range;
pub use parser::parse_children;
pub use parser::read_box_header;
pub use registry::BoxValue;
pub use registry::Registry;

Modules§

boxes
json_api
known_boxes
parser
registry
util