media-pp is a small, GStreamer-flavored media pipeline library for Rust,
built on ffmpeg-next. Stages are synchronous calls by default, and thread
boundaries are explicit bounded queues.
- Errors come back as
Result. A stage's failure returns straight up the call stack; only past aQueuedoes it become a bus event. - Running pipelines change shape. Branches are added and finished while buffers flow, and filters are swapped without reopening the source.
- GPU-resident end to end on D3D11, D3D12, CUDA, Vulkan or
VideoToolbox and Metal: decode, scale, composite, key and encode without
copying pictures back to the CPU.
VideoDecodeBinandVideoEncodeBinpick the hardware where it opens and fall back to software where it does not. - Capture of screens, windows, cameras and audio on Windows, Linux and macOS; output to files, HLS, RTMP and RTSP servers, and WebRTC.
- Playback control: seek, pause, step, speed and reverse, with a preroll
that shows the picture sought to before playing on.
Playerplays a file with its sound in a window in a dozen lines.
Every element, by what it does and which backend it runs on, is in docs/elements.md.
[dependencies]
media-pp = "0.3"FFmpeg 8.0 or newer development libraries and Rust 1.88 or newer are
needed; the library has no default features, and each backend, capture and
output is one — see docs/features.md. A first pipeline
and a first Player are in
docs/getting-started.md.
How a pipeline runs is the crate documentation's first page, on docs.rs for the backend-independent and Linux API, and in the Windows API documentation and the macOS API documentation for everything on those platforms.
The library crate lives in lib/; each directory below examples/ is a
crate of its own:
cargo run -p player -- path/to/video.mp4Setting up FFmpeg and each platform's SDKs is in
docs/building, and testing in
CONTRIBUTING.md.
| Getting started | Adding the crate, a file's pipeline, playing a file, where to read on |
| Elements | Every element, by what it does and by backend |
| Features | Every feature flag, its platform, and what it needs to build |
| Examples | The example crates and how to run them |
| Building | Setting up Windows, Linux and macOS to build and test |
| Vision benchmarks | How fast detection, tracking and classification run, against what the GPU can do |
| Stream events | Design record of how segments, flushes and the end of a stream travel |
CHANGELOG.md |
What changed between versions, and what to write instead |
CONTRIBUTING.md |
Testing, the control conformance matrix, soak tests |
AGENTS.md holds the repository's design and review rules, for
people and coding agents alike.
Licensed under either the Apache License, Version 2.0 or the MIT License, at your option.
media-pp does not bundle FFmpeg. Users are responsible for complying with
the license of their FFmpeg build and optional codecs.