FS#62445 - [ffmpeg] Build against dav1d for faster AV1 decoding

Attached to Project: Arch Linux
Opened by Link Mauve (linkmauve) - Tuesday, 23 April 2019, 11:27 GMT
Last edited by Maxime Gauduin (Alucryd) - Tuesday, 17 September 2019, 17:00 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Maxime Gauduin (Alucryd)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 6
Private No

Details

Description:
ffmpeg is currently built with --enable-libaom, to let it decode and encode AV1 videos. It is pretty slow at decoding though, so ffmpeg added --enable-libdav1d to use the much faster dav1d decoder, see http://www.jbkempf.com/blog/post/2019/dav1d-shifts-up-a-gear-0.2-is-out%21 for benchmarks, as it basically makes the difference between playable 1080p and unplayable 1080p.

Additional info:
* package version(s)
ffmpeg 1:4.1.3-1
aom 1.0.0-1
dav1d 0.2.1-1

* config and/or log files etc.
N/A

* link to upstream bug report, if any
N/A

Steps to reproduce:
youtube-dl -f 399+251 https://youtu.be/k2qgadSvNyU
ffplay *k2qgadSvNyU*.mkv
Notice how it is jaggy and uses a lot of CPU with aom, and smooth with dav1d.
This task depends upon

Closed by  Maxime Gauduin (Alucryd)
Tuesday, 17 September 2019, 17:00 GMT
Reason for closing:  Implemented
Additional comments about closing:  1:4.2.1-2
Comment by DrZaius (DrZaius) - Thursday, 20 June 2019, 18:43 GMT
This will have to wait for FFmpeg 4.2. libdav1d support is not, and will not, be available for the 4.1 release branch.
Comment by James Almer (jamrial) - Tuesday, 06 August 2019, 13:58 GMT
FFmpeg 4.2 was released with support for libdav1d. It should be a matter of enabling it.
Comment by Dietrich Hallentforden (aufkrawall) - Sunday, 15 September 2019, 13:46 GMT
  • Field changed: Percent Complete (100% → 0%)
As long as ffmpeg is compiled with "--enable-libaom", it is still used when playing AV1 video in mpv, despite of having "--enable-libdav1d" set. This results in unusable performance.
Comment by god geu (ghodgeuk) - Sunday, 15 September 2019, 17:13 GMT
You must clearly indicate which decoder you want to use.
mpv --vd=libdav1d
or with libaom
mpv --vd-lavc-threads=1

Archlinux libaom library is unusable in practice.
!!! No multithread support !!! Only ONE thread !!!
ffmpeg -benchmark -c:v libaom-av1 -threads 1 -i input.av1 -f null null
Compared to the git version, it is about ~2.5x slower in decoding and ~8x in encoding (not including multi-threading, in reality they are many times worse). Crap.
What can it be used for? Anyone who wants to encode AV1 will compile the libaom git version + ffmpeg in 2 minutes.

Edit:
The default AV1 decoder used by ffmpeg should be faster.
It is currently dav1d (compared to aom-git significantly, compared to aom-1.0.0.errata1-1 extremely).
Comment by god geu (ghodgeuk) - Tuesday, 17 September 2019, 08:20 GMT
In ffmpeg this trivial change has been made.

avcodec/allcodecs: make libdav1d the preferred AV1 decoder
https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/dc0806dd25882f41f6085c8356712f95fded56c7

Comment by Dietrich Hallentforden (aufkrawall) - Tuesday, 17 September 2019, 14:37 GMT
Recompile with the improvement included is now in stable repo and works as expected. Thx @ maintainer.
Comment by Maxime Gauduin (Alucryd) - Tuesday, 17 September 2019, 16:59 GMT
No problem, I'll close the issue then.

Loading...