Skip to content

dav1d

currentMigrated from docs/utilities/dav1d.mdx at 37c3317fd058; modified for Encode Wiki · CC BY-SA 4.0

videolan/dav1d

code.videolan.org

dav1d is the fastest AV1 decoder on all platforms :) Targeted to be small, portable and very fast.

Latest release
1.5.4
Last commit
License
BSD-2-Clause

dav1d (“dav1d is an AV1 decoder”) is the AV1 software decoder from VideoLAN, developed largely by Two Orioles and VideoLAN contributors. It supports every AV1 feature, bit depth (8, 10 and 12) and chroma subsampling, and has hand-written assembly for x86 (SSE2 up to AVX-512) and Arm, which makes it much faster than libaom’s decoder. It is BSD-2-Clause licensed so that anyone can embed it.

You rarely run it directly: it is the AV1 decoder inside FFmpeg (libdav1d), VLC, mpv, Firefox and Chromium-based browsers, so whenever you watch an AV1 encode without hardware decoding, dav1d is probably doing the work. The standalone dav1d tool is still handy for checking how hard a stream is to decode and whether two decodes are identical.

Most Linux distributions, Homebrew and MSYS2 package it as dav1d (the library and the CLI). To build it, you need Meson, Ninja and, on x86, NASM:

Terminal window
git clone https://code.videolan.org/videolan/dav1d.git
cd dav1d && meson setup build && ninja -C build

The binary is build/tools/dav1d. The canonical repository is on VideoLAN’s GitLab; the GitHub repository is a mirror.

dav1d reads raw AV1 only: IVF, Annex B or Section 5 OBU streams. It cannot open MKV, WebM or MP4, so extract the track first:

Terminal window
mkvextract input.mkv tracks 0:video.ivf
ffmpeg -i input.mp4 -map 0:v:0 -c copy video.ivf

Then:

Terminal window
dav1d -i video.ivf -o decoded.y4m # decode to Y4M
dav1d -i video.ivf --muxer null # decode and discard, printing the speed
dav1d -i video.ivf --muxer null --threads 1 # single-threaded speed
dav1d -i video.ivf --muxer md5 -o decoded.md5 # MD5 of the decoded frames, without grain

The --muxer null run is the quickest way to see whether an encode will play smoothly on a weak device: compare the fps with one or two threads against the video’s frame rate. Resolution, frame rate and film-grain synthesis all raise decode cost.

OptionDefaultUse
--threads N0 (all cores)Worker threads.
--framedelay N0 (automatic)Maximum frames in flight; 1 gives lowest latency at the cost of speed.
--filmgrain 0/11Apply signalled film grain. An explicit --muxer md5 or xxh3, and --verify, switch it off so checksums cover the picture without grain; -o file.md5 alone still applies grain.
--limit NnoneStop after N frames.
--skip N0Skip the first N frames.
--verify MD5offDecode and compare against an expected MD5; exits non-zero on a mismatch.
--cpumaskallRestrict SIMD (sse2, ssse3, sse41, avx2, avx512icl) to see how slower CPUs fare.
--oppoint N, --alllayers0, 1Choose the operating point and layers of scalable streams.

FFmpeg uses libdav1d automatically for AV1 when the build includes it; FFmpeg’s native AV1 decoder only works with hardware acceleration. Decoder options go before -i. To decode without applying film grain, for example to look at the encoded picture before synthesis, export the grain parameters instead of applying them:

Terminal window
ffmpeg -export_side_data film_grain -i input.mkv -c:v ffv1 nograin.mkv

The older -filmgrain 0 option does the same but is deprecated. -threads, -max_frame_delay, -oppoint and -alllayers correspond to the CLI options above.