Expand description
§revelo — read technical metadata from any media file
A pure-Rust, zero-unsafe library for extracting technical and tag metadata
from media files. No system libraries, no Perl runtime, no ./Configure.
- Detects 180+ container and codec formats (MP4, Matroska, MPEG-TS, AVI, WAV, …)
- Extracts container/codec fields — duration, bitrate, resolution, frame rate, HDR
- Decodes EXIF, IPTC, XMP, ICC, C2PA embedded in photos and video
- Optionally decodes deep maker-notes from 14 camera vendors (Canon, Nikon, Fujifilm,
Olympus, Sony, Panasonic, …) via the
exiftool-tablesfeature
§Quick start
Parse a video file (memory-mapped — only the metadata regions are faulted in, not the entire file). Works the same for small JPEGs and multi-GB videos:
let meta = revelo::Metadata::from_file("video.mp4").unwrap();
for (key, value) in meta.general() {
println!("{key} = {value}");
}
for (key, value) in meta.video() {
println!("{key} = {value}");
}
for (key, value) in meta.audio() {
println!("{key} = {value}");
}Parse a photo from an in-memory buffer and read its EXIF tags:
let bytes = std::fs::read("photo.jpg").unwrap();
let meta = revelo::Metadata::from_bytes(&bytes).unwrap();
for (key, value) in meta.exif() {
println!("{key} = {value}");
}
for (key, value) in meta.iptc() {
println!("{key} = {value}");
}
for (key, value) in meta.xmp() {
println!("{key} = {value}");
}§Memory semantics
| Method | I/O model | Memory use | Use when |
|---|---|---|---|
Metadata::from_file | Memory-mapped (mmap) | OS pages in only accessed regions | Local files — tiny, large, or huge |
Metadata::from_bytes | Already in memory (borrowed) | Zero copy from the caller’s buffer | Bytes from a network fetch, embedded asset, or include_bytes! |
Metadata::from_file_owned | Reads entire file into Vec<u8> | Proportional to file size | Fallback when mmap is unavailable or caller wants ownership |
For 99% of use cases: use from_file for files, from_bytes for buffers.
Both extract the same metadata; the difference is how the bytes reach the parser.
§Key types
| Type / function | What it does |
|---|---|
Metadata | Main entry point — parse a file or buffer, iterate streams |
Metadata::from_file | Parse from a file path (memory-mapped) |
Metadata::from_bytes | Parse from an in-memory &[u8] |
Metadata::from_file_owned | Parse from a file path (full file read, fallback) |
MediaFile | Low-level byte-parsing engine (FileAnalyze alias) |
revelo_core::stream::StreamCollection | Raw per-kind stream store |
revelo_core::stream::StreamKind | Discriminant for General/Video/Audio/Exif/… |
§exiftool-tables feature
By default revelo uses hand-written clean-room maker-note tables (BSD-2-Clause).
Enable the exiftool-tables feature for ExifTool-grade depth:
[dependencies]
revelo = { version = "0.5", features = ["exiftool-tables"] }License caveat: exiftool-tables pulls in revelo-exiftool-tables
(GPL-1.0-or-later OR Artistic-1.0-Perl, © Phil Harvey). A binary or library
built with this feature is subject to those terms.
Re-exports§
pub use revelo_core;pub use revelo_dispatcher;pub use revelo_parsers_tag;
Structs§
- Metadata
- Parsed metadata from a media file.
Type Aliases§
- Media
File - The engine that reads bytes and produces metadata.