]> pere.pagekite.me Git - homepage.git/blob - blog/data/2022-04-16-debian-av1.txt
Generated.
[homepage.git] / blog / data / 2022-04-16-debian-av1.txt
1 Title: Playing and encoding AV1 in Debian Bullseye
2 Tags: english, standard, video
3 Date: 2022-04-16 08:40
4
5 <p>Inspired by the recent news of
6 <a href="https://slashdot.org/story/22/04/03/2039219/intel-beats-amd-and-nvidia-with-arc-gpus-full-av1-support">AV1
7 hardware encoding support from Intel</a>, I decided to look into
8 the state of AV1 on Linux today. AV1 is a
9 <a href="https://web.archive.org/web/20160618103850/http://www.digistan.org/open-standard:definition">free
10 and open standard</a> as defined by Digistan without any royalty
11 payment requirement, unlike its much used competitor encoding
12 H.264. While looking, I came across an 5 year
13 <a href="https://askubuntu.com/questions/1061908/how-to-encode-and-playback-video-with-the-av1-codec-on-bionic-beaver-18-04">old
14 question on askubuntu.com</a> which in turn inspired me to check out
15 how things are in Debian Stable regarding AV1. The test file listed
16 in the question (askubuntu_test_aom.mp4) did not exist any more, so I
17 tracked down a different set of test files on
18 <a href="https://av1.webmfiles.org/">av1.webmfiles.org</a> to test them
19 with the various video tools I had installed on my machine. I was
20 happy to discover that AV1 decoding and playback worked with almost
21 every tool I tested:
22
23 <table align="center">
24 <tr><td>mediainfo</td> <td>ok</td></tr>
25 <tr><td>dragonplayer</td> <td>ok</td></tr>
26 <tr><td>ffmpeg / ffplay</td> <td>ok</td></tr>
27 <tr><td>gnome-mplayer</td> <td>fail</td></tr>
28 <tr><td>mplayer</td> <td>ok</td></tr>
29 <tr><td>mpv</td> <td>ok</td></tr>
30 <tr><td>parole</td> <td>ok</td></tr>
31 <tr><td>vlc</td> <td>ok</td></tr>
32 <tr><td>firefox</td> <td>ok</td></tr>
33 <tr><td>chromium</td> <td>ok</td></tr>
34 </table>
35
36 <p>AV1 encoding is available in Debian Stable from the aom-tools
37 version 1.0.0.errata1-3 package, using the aomenc tool. The encoding
38 using the package in Debian Stable is quite slow, with the frame rate
39 for my 10 second test video at around 0.25 fps. My 10 second video
40 test took 16 minutes and 11 seconds on my test machine.</p>
41
42 <p>I tested by first running ffmpeg and then aomenc using the recipe
43 provided by the askubuntu recipe above. I had to remove the
44 '--row-mt=1' option, as it was not supported in my 1.0.0 version. The
45 encoding only used a single thread, according to <tt>top</tt>.</p>
46
47 <blockquote><pre>
48 ffmpeg -i some-old-video.ogv -t 10 -pix_fmt yuv420p video.y4m
49 aomenc --fps=24/1 -u 0 --codec=av1 --target-bitrate=1000 \
50 --lag-in-frames=25 --auto-alt-ref=1 -t 24 --cpu-used=8 \
51 --tile-columns=2 --tile-rows=2 -o output.webm video.y4m
52 </pre></blockquote>
53
54 <p>As version 1.0.0 currently have several
55 <a href="https://security-tracker.debian.org/tracker/source-package/aom">unsolved
56 security issues in Debian Stable</a>, and to see if the recent
57 backport <a href="https://tracker.debian.org/pkg/aom">provided in
58 Debian</a> is any quicker, I ran <tt>apt -t bullseye-backports install
59 aom-tools</tt> to fetch the backported version and re-encoded the
60 video using the latest version. This time the '--row-mt=1' option
61 worked, and the encoding was done in 46 seconds with a frame rate of
62 around 5.22 fps. This time it seem to be using all my four cores to
63 encode. Encoding speed is still too low for streaming and real time,
64 which would require frame rates above 25 fps, but might be good enough
65 for offline encoding.</p>
66
67 <p>I am very happy to see AV1 playback working so well with the
68 default tools in Debian Stable. I hope the encoding situation improve
69 too, allowing even a slow old computer like my 10 year old laptop to
70 be used for encoding.</p>
71
72 <p>As usual, if you use Bitcoin and want to show your support of my
73 activities, please send Bitcoin donations to my address
74 <b><a href="bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b</a></b>.</p>