altc264-cli 0.1.1

Command-line tools for the altc264 decoder
altc264-cli-0.1.1 is not a library.

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 altc264::decoder::Decoder;

let mut dec = Decoder::with_auto_threads();
dec.decode_annex_b(&data);
dec.flush();
while let Some(frame) = dec.next_frame() {
    let y = frame.plane(0).unwrap(); // rows of luma samples
}

C

cargo cinstall --release -p altc264-capi --prefix /usr/local

See crates/altc264-capi/include/altc264.h.

FFmpeg and GStreamer

  • FFmpeg: integrations/ffmpeg adds a libaltc264 decoder (./apply.sh /path/to/ffmpeg, then --enable-libaltc264). Tested with FFmpeg 8.1.3 and 9.0.2.
  • GStreamer: integrations/gstreamer is an altc264dec element.

Command line

cargo install --path crates/altc264-cli
altc264 decode input.264 left.yuv right.yuv

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.