<p align="center">
<h1 align="center">rsmediainfo</h1>
<p align="center">
Media metadata extraction for Rust — one API, every format MediaInfo understands.
</p>
<p align="center">
<a href="https://crates.io/crates/rsmediainfo"><img src="https://img.shields.io/crates/v/rsmediainfo.svg" alt="Crates.io"></a>
<a href="https://docs.rs/rsmediainfo"><img src="https://img.shields.io/docsrs/rsmediainfo" alt="docs.rs"></a>
<a href="LICENSE-MIT"><img src="https://img.shields.io/crates/l/rsmediainfo.svg" alt="License"></a>
<img src="https://img.shields.io/badge/MSRV-1.88-blue.svg" alt="MSRV 1.88">
</p>
</p>
---
- **Idiomatic API** — small, ergonomic surface over the MediaInfo C library
- **Flexible inputs** — parse from file paths, `Read` sources, in-memory buffers, or remote URLs
- **Structured tracks** — typed `MediaInfo` and `Track` models with insertion-ordered attributes
- **Multiple output formats** — text, JSON, XML, or `%`-delimited templates straight from the library
- **Pre-parsed XML** — build a `MediaInfo` from an existing XML payload with no shared library required
- **Bundled library** — optional download of the MediaInfo shared library at build time
- **Reusable context** — `MediaInfoContext` loads the shared library once and reuses it across many parse calls for batch workloads
- **Configurable parsing** — parse speed, completion level, cover art, custom library options, encoding error policy
- **Typed errors** — every failure mode of the underlying library surfaced through `MediaInfoError`
- **Thread-safe** — internal serialization keeps the library's global option store deterministic across threads
## Installation
```toml
[dependencies]
rsmediainfo = "0.2.0"
# Use a system-installed MediaInfo library instead of the bundled one:
# rsmediainfo = { version = "0.2.0", default-features = false }
```
## Feature Flags
| `bundled` | Download the MediaInfo shared library for the target platform during the build (enabled by default) |
> See the [`examples/`](examples/) directory for parsing from paths, readers, URLs, raw output, pre-generated XML, and batch parsing through a reusable `MediaInfoContext`.
## License
Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in rsmediainfo by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.