altc264 decodes H.264 from Baseline to the professional 4:4:4 profiles, and both views of Blu-ray 3D and other MVC streams, fast enough for real-time stereo playback on XR headsets. It is bit-exact against the ITU-T H.264.1 conformance suites, which CI checks on every change. Live browser demo available here.
Features
- Profiles: Baseline, Main, High, High 10, High 4:2:2 and High 4:4:4, including intra-only, lossless, interlaced (field and MBAFF) and 9 to 14-bit video. Extended profile SP and SI slices (not data partitioning).
- MVC: Stereo High and Multiview High, every view, with side-by-side, top-and-bottom or frame-packed output and Blu-ray 3D plane offsets for subtitles.
- Fast: frame threading, and SIMD for NEON, SSE2/AVX2 and WebAssembly, with a portable fallback.
- Easy to embed: a Rust crate, a C library, and FFmpeg and GStreamer integrations.
Platforms
| Platform | Architectures | SIMD |
|---|---|---|
| Apple: macOS, iOS, iPadOS, tvOS, visionOS | arm64, and x86_64 on macOS | NEON, SSE2/AVX2 on Intel |
| Android | arm64-v8a, x86_64 | NEON, SSE2/AVX2 |
| Linux | x86_64, aarch64 | SSE2/AVX2, NEON |
| Windows | x86_64, arm64 | SSE2/AVX2, NEON |
| WebAssembly | wasm32 (WASI) | SIMD128, threaded where the host allows it |
Other targets build with the portable fallback.
Conformance
All 270 ITU-T H.264.1 conformance streams are bit-exact on every CPU
backend, in every view the reference decoders can produce. The expected output of each stream is in
conformance/manifest.json.
Performance
Against FFmpeg 9.0.2's H.264 decoder, on this public 1080p clip of Big Buck Bunny.
3D (MVC)
Frames per second decoding both views of a 3D clip of Big Buck Bunny (bbb3d-mvc-10s.264, 1080p).
| CPU | 1 thread | 8 threads |
|---|---|---|
| Apple M4 Pro | 87 | 546 |
| Intel Core Ultra X9 388H | 74 | 301 |
| AMD Ryzen AI 9 HX 370 | 62 | 339 |
| Qualcomm QCM6490 | 36 | 124 |
| WebAssembly (SIMD128) | 48 | 306 |
Full details in BENCHMARKS.md.
Usage
Rust
use Decoder;
let mut dec = with_auto_threads;
dec.decode_annex_b;
dec.flush;
while let Some = dec.next_frame
C
See crates/altc264-capi/include/altc264.h.
FFmpeg and GStreamer
- FFmpeg:
integrations/ffmpegadds alibaltc264decoder (./apply.sh /path/to/ffmpeg, then--enable-libaltc264). Tested with FFmpeg 8.1.3 and 9.0.2. - GStreamer:
integrations/gstreameris analtc264decelement.
Command line
Contributing
See CONTRIBUTING.md, including its AI policy. Report security issues privately, as described in SECURITY.md.
Licence
See LICENSE. The FFmpeg wrapper in
integrations/ffmpeg is LGPL-2.1-or-later, like FFmpeg.
The licence covers this code only. H.264 is subject to patents in many jurisdictions, whoever distributes binaries is responsible for any licensing they require.