<p align="center">
<h1 align="center">rsmp4decrypt</h1>
<p align="center">
MP4 decryption for Rust - Bento4 <code>mp4decrypt</code> as a library and CLI.
</p>
<p align="center">
<a href="https://crates.io/crates/rsmp4decrypt"><img src="https://img.shields.io/crates/v/rsmp4decrypt.svg" alt="Crates.io"></a>
<a href="https://docs.rs/rsmp4decrypt"><img src="https://img.shields.io/docsrs/rsmp4decrypt" alt="docs.rs"></a>
<a href="LICENSE-MIT"><img src="https://img.shields.io/crates/l/rsmp4decrypt.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, focused Rust surface over Bento4 decryption
- **CLI parity for core inputs** - accepts `--key`, `--fragments-info`, and `--show-progress`
- **Track ID and KID keys** - use decimal track IDs or 128-bit hexadecimal KIDs
- **File and memory decryption** - decrypt from paths or in-memory buffers
- **Progress callbacks** - report Bento4 progress in library code or through the bundled CLI
- **Reusable context** - build a `Mp4Decryptor` once and reuse it across many decrypt calls
- **Typed errors** - all public failures are surfaced through `rsmp4decrypt::Error`
- **Thread-safe usage** - internal serialization keeps Bento4 stable across concurrent callers
- **Vendored native sources** - published crates build from the checked-in `vendor/bento4-src` snapshot
## Installation
```toml
[dependencies]
rsmp4decrypt = "0.1.0"
```
To install the CLI:
```powershell
cargo install rsmp4decrypt
```
## Feature Flags
This crate currently has no optional Cargo features.
> See the [`examples/`](examples/) directory for file decryption, in-memory decryption, and progress reporting.
## 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 rsmp4decrypt by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.