Wedeo – a Rust Rewrite of FFmpeg
Article URL: https://github.com/sharifhsn/wedeo Comments URL: https://news.ycombinator.com/item?id=47601272 Points: 3 # Comments: 4
Rust rewrite of FFmpeg, verified against FFmpeg's output bit-for-bit.
This codebase is AI-generated. Written by Claude (Anthropic) via Claude Code, directed and reviewed by a human. The AI reads FFmpeg's C source and reimplements it in Rust. Every conformance claim below is verified by automated CI on every commit, comparing to FFmpeg's output.
The intention of this project is to push the boundaries of what is possible with AI rewriting codebases in Rust. It provides no additional features compared to FFmpeg, and despite incorporating FFmpeg's assembly code, is significantly slower.
Status
Component Conformance Notes
H.264 decode 79/79 BITEXACT CAVLC + CABAC, Baseline through High profile
H.264 FRext 23/55 bitexact Progressive 4:2:0 8-bit done; MBAFF/PAFF/10-bit remaining
H.264 NEON (aarch64)
1.75x speedup
MC, IDCT, deblock — FFmpeg's vendored assembly via cc
WAV demuxer + PCM bitexact RIFF/RIFX/RF64/BW64, 17 PCM formats, 13/13 FATE files
WAV muxer bitexact Roundtrip verified
FLAC, WavPack bitexact Via symphonia adapter
Vorbis, AAC, MP3 ~120-140 dB SNR Lossy codecs, float precision only
AV1 bitexact Via rav1d adapter
MP4 demuxer working H.264, AV1, AAC tracks
Video player 24fps 0-drop GPU (wgpu), ffplay-style A/V sync, pause, volume
H.264 decoder
The H.264 decoder is ~30K lines of Rust across 25 modules. It implements:
-
CAVLC and CABAC entropy coding
-
All intra prediction modes (4x4, 8x8, 16x16, chroma)
-
Quarter-pel motion compensation (6-tap FIR luma, bilinear chroma)
-
4x4 and 8x8 IDCT with Hadamard DC transforms
-
In-loop deblocking filter
-
MMCO and sliding-window reference management
-
Weighted prediction (uni/bi)
-
B-frames with direct prediction (spatial + temporal)
-
High profile: 8x8 transforms, custom scaling matrices
-
MBAFF interlaced (partial — field/frame MB switching, CABAC context adaptation)
-
Frame-level threading with wavefront deblocking
-
aarch64 NEON assembly for MC, IDCT, and deblocking (feature-gated)
Architecture details: H264.md. Known FFmpeg behavioral differences: DIVERGENCES.md.
Not yet implemented
FFmpeg has hundreds of codecs and formats. wedeo currently covers a small subset. Major gaps for parity:
-
Video codecs — VP9, HEVC/H.265, MPEG-2, MPEG-4 Part 2, VP8, Theora. H.264 is missing interlaced (MBAFF/PAFF), 10-bit, and 4:2:2/4:4:4.
-
Video encoding — no encoders exist yet (H.264, H.265, AV1 via rav1e)
-
Muxers — only WAV. No MP4/MOV, MKV/WebM, or MPEG-TS muxer.
-
Demuxers — no MKV/WebM, MPEG-TS, FLV, or AVI demuxer (MP4 and WAV only, plus symphonia-backed formats)
-
Filters — trait skeleton exists but no functional filter graph (no scale, crop, overlay, fps, etc.)
-
Player — no seek, no subtitle rendering, no hardware-accelerated decode
-
Infrastructure — no interruptible I/O (network streams), no chapter/program support, no avformat_find_stream_info equivalent
Quick start
Install the CLI
# From source (includes AV1 support via rav1d) cargo install --git https://github.com/sharifhsn/wedeo wedeo-cli# From source (includes AV1 support via rav1d) cargo install --git https://github.com/sharifhsn/wedeo wedeo-cliPlay a video
# Also from source — AV1, H.264, and audio all work cargo install --git https://github.com/sharifhsn/wedeo wedeo-play wedeo-play video.mp4# Also from source — AV1, H.264, and audio all work cargo install --git https://github.com/sharifhsn/wedeo wedeo-play wedeo-play video.mp4Use as a library
# Cargo.toml — core crates are on crates.io [dependencies] wedeo = "0.1.2" wedeo-codec-h264 = "0.1.2" # H.264 decoder wedeo-format-mp4 = "0.1.2" # MP4 demuxer wedeo-symphonia = "0.1.2" # audio codecs (AAC, MP3, FLAC, etc.)# Cargo.toml — core crates are on crates.io [dependencies] wedeo = "0.1.2" wedeo-codec-h264 = "0.1.2" # H.264 decoder wedeo-format-mp4 = "0.1.2" # MP4 demuxer wedeo-symphonia = "0.1.2" # audio codecs (AAC, MP3, FLAC, etc.)AV1 requires a git dependency (rav1d is not yet on crates.io)
wedeo-rav1d = { git = "https://github.com/sharifhsn/wedeo" }`
Build and test locally
cargo build cargo nextest run # or cargo test cargo clippycargo build cargo nextest run # or cargo test cargo clippyDecode a file and compare against FFmpeg:
cargo run --release --bin wedeo-framecrc -- input.264 ffmpeg -bitexact -i input.264 -f framecrc -cargo run --release --bin wedeo-framecrc -- input.264 ffmpeg -bitexact -i input.264 -f framecrc -FATE testing
FFmpeg's native test suite.
./scripts/fetch-fate-suite.sh # downloads full suite (~1.2 GB) FATE_SUITE=./fate-suite cargo nextest run -p wedeo-fate./scripts/fetch-fate-suite.sh # downloads full suite (~1.2 GB) FATE_SUITE=./fate-suite cargo nextest run -p wedeo-fateJVT conformance (ITU test vectors)
204 test vectors from the ITU JVT conformance suite, with MD5 ground truth from the Fluster project. No FFmpeg required — comparison is against ITU-provided checksums.
python3 scripts/fetch_jvt.py # download vectors (~50 MB) python3 scripts/suite_runner.py --suite jvt-avc-v1,jvt-fr-ext --format yuv420ppython3 scripts/fetch_jvt.py # download vectors (~50 MB) python3 scripts/suite_runner.py --suite jvt-avc-v1,jvt-fr-ext --format yuv420pThe unified suite runner also wraps the FATE suites:
python3 scripts/suite_runner.py --suite all --format yuv420p python3 scripts/suite_runner.py --suite fate-cavlc --save-snapshot python3 scripts/suite_runner.py --suite fate-cavlc --check-snapshot # regression checkpython3 scripts/suite_runner.py --suite all --format yuv420p python3 scripts/suite_runner.py --suite fate-cavlc --save-snapshot python3 scripts/suite_runner.py --suite fate-cavlc --check-snapshot # regression checkArchitecture
wedeo/ crates/ wedeo-core/ libavutil — Rational, Buffer, Frame, Packet, errors wedeo-codec/ libavcodec — Decoder/Encoder traits, codec registry wedeo-format/ libavformat — Demuxer/Muxer traits, I/O, InputContext wedeo-filter/ libavfilter (stub) wedeo-resample/ libswresample (rubato) wedeo-scale/ libswscale (dcv-color-primitives) codecs/ wedeo-codec-h264/ H.264 decoder — 30K lines, NEON assembly, 55 benchmarks wedeo-codec-pcm/ PCM codec — 17 formats formats/ wedeo-format-h264/ H.264 Annex B demuxer wedeo-format-wav/ WAV demuxer + muxer wedeo-format-mp4/ MP4/MOV demuxer adapters/ wedeo-symphonia/ Wraps symphonia (FLAC, Vorbis, MP3, AAC, WavPack) wedeo-rav1d/ Wraps rav1d (AV1) bins/ wedeo-cli/ CLI tool wedeo-play/ Video player — wgpu+winit, ffplay-style A/V sync tests/ fate/ FATE cross-validation harness scripts/ suite_runner.py Unified conformance runner (FATE + JVT) fetch_jvt.py JVT vector downloader conformance_full.py FATE conformance report regression_check.py Quick regression check test_suites/ h264/ JVT manifest JSONs (tracked)wedeo/ crates/ wedeo-core/ libavutil — Rational, Buffer, Frame, Packet, errors wedeo-codec/ libavcodec — Decoder/Encoder traits, codec registry wedeo-format/ libavformat — Demuxer/Muxer traits, I/O, InputContext wedeo-filter/ libavfilter (stub) wedeo-resample/ libswresample (rubato) wedeo-scale/ libswscale (dcv-color-primitives) codecs/ wedeo-codec-h264/ H.264 decoder — 30K lines, NEON assembly, 55 benchmarks wedeo-codec-pcm/ PCM codec — 17 formats formats/ wedeo-format-h264/ H.264 Annex B demuxer wedeo-format-wav/ WAV demuxer + muxer wedeo-format-mp4/ MP4/MOV demuxer adapters/ wedeo-symphonia/ Wraps symphonia (FLAC, Vorbis, MP3, AAC, WavPack) wedeo-rav1d/ Wraps rav1d (AV1) bins/ wedeo-cli/ CLI tool wedeo-play/ Video player — wgpu+winit, ffplay-style A/V sync tests/ fate/ FATE cross-validation harness scripts/ suite_runner.py Unified conformance runner (FATE + JVT) fetch_jvt.py JVT vector downloader conformance_full.py FATE conformance report regression_check.py Quick regression check test_suites/ h264/ JVT manifest JSONs (tracked)Each FFmpeg library maps to one Rust crate. Codecs and formats register themselves via inventory at link time — no central enum.
CI
Five parallel jobs run on every PR (all required to merge):
-
Lint — clippy + rustfmt
-
Test — 462 unit and integration tests via nextest
-
FATE Regression — no previously-passing FATE test may regress (framecrc vs FFmpeg)
-
JVT Regression — no previously-passing JVT test may regress (MD5 vs ITU checksums)
-
Deny — license allow-list and advisory audit via cargo-deny
Conformance baselines are committed in test_suites/baselines/. To update after expanding coverage:
python3 scripts/suite_runner.py --suite fate-cavlc,fate-cabac \ --save-snapshot --snapshot-dir test_suites/baselinespython3 scripts/suite_runner.py --suite fate-cavlc,fate-cabac \ --save-snapshot --snapshot-dir test_suites/baselinesPre-commit hook available: pip install pre-commit && pre-commit install
FFmpeg reference
The FFmpeg/ submodule is pinned to n8.1. Optional — only needed to read the C source or build a debug FFmpeg for development:
git submodule update --init cd FFmpeg && ./configure --disable-optimizations --enable-debug=3 \ --disable-stripping --disable-asm && make -j$(nproc) ffmpeggit submodule update --init cd FFmpeg && ./configure --disable-optimizations --enable-debug=3 \ --disable-stripping --disable-asm && make -j$(nproc) ffmpegContributing
See CONTRIBUTING.md.
For AI agents
This repo is designed for AI-assisted development. CLAUDE.md contains the full project context: architecture, conventions, debugging procedures, and technical requirements. It is the canonical reference for any AI agent working on this codebase — read it before writing code.
The llms.txt file provides a machine-readable project summary following the llms.txt convention.
License
LGPL-2.1-or-later. See LICENSE and COPYING.LGPLv2.1.
Sign in to highlight and annotate this article

Conversation starters
Daily AI Digest
Get the top 5 AI stories delivered to your inbox every morning.
More about
github
llama.cpp fixes to run Bonsai 1-bit models on CPU (incl AVX512) and AMD GPUs
PrismAI's fork of llama.cpp is broken if you try to run on CPU. This also includes instructions for running on AMD GPUs via ROCm. https://github.com/philtomson/llama.cpp/tree/prism submitted by /u/UncleOxidant [link] [comments]
Knowledge Map
Connected Articles — Knowledge Graph
This article is connected to other articles through shared AI topics and tags.
More in Open Source AI
Google - Gemma 4 now in Unsloth!
Google releases Gemma 4 with four new models: E2B, E4B, 26B-A4B, 31B. You can now run and train the Gemma 4 models in Unsloth. Guide / Blog: https://unsloth.ai/docs/models/gemma-4 The multimodal reasoning models are licensed under Apache 2.0. Run E2B and E4B on 6GB RAM, and on phones. Run 26B-A4B and 31B on ~18GB. GGUFs: https://huggingface.co/collections/unsloth/gemma-4 Updates Tool calls for smaller models are now more stable and don't cut off anymore Context length is now properly applied. Tool calls for all models are now +30% to +80% more accurate. Web search now actually gets web content and not just summaries Number of tool calls allowed are increased to 25 from 10 Tool calls now terminate much better, so looping / repetitions will be reduced More tool call healing and de-duplicatio



Discussion
Sign in to join the discussion
No comments yet — be the first to share your thoughts!