From: Petter Reinholdtsen Date: Sat, 16 Apr 2022 06:31:03 +0000 (+0200) Subject: New post on AV1. X-Git-Url: https://pere.pagekite.me/gitweb/homepage.git/commitdiff_plain/571e6abba9045291676bbaa1b416285c7866039b New post on AV1. --- diff --git a/blog/data/2022-04-16-debian-av1.txt b/blog/data/2022-04-16-debian-av1.txt new file mode 100644 index 0000000000..60db6cef2d --- /dev/null +++ b/blog/data/2022-04-16-debian-av1.txt @@ -0,0 +1,74 @@ +Title: Playing and encodingd AV1 in Debian Bullseye +Tags: english, standard, video +Date: 2022-04-16 08:40 + +

Inspired by the recent news of +AV1 +hardware encoding support from Intel, I decided to look into +the state of AV1 on Linux today. AV1 is a +free +and open standard as defined by Digistan without any royalty +payment requirement, unlike its much used competitor encoding +H.264. While looking, I came across an 5 year +old +question on askubuntu.com which in turn inspired me to check out +how things are in Debian Stable regarding AV1. The test file listed +in the question (askubuntu_test_aom.mp4) did not exist any more, so I +tracked down a different set of test files on +av1.webmfiles.org to test them +with the various video tools I had installed on my machine. I was +happy to discover that AV1 decoding and playback worked with almost +every tool I tested: + + + + + + + + + + + + +
mediainfo ok
dragonplayer ok
ffmpeg / ffplay ok
gnome-mplayer fail
mplayer ok
mpv ok
parole ok
vlc ok
firefox ok
chromium ok
+ +

AV1 encoding is available in Debian Stable from the aom-tools +version 1.0.0.errata1-3 package, using the aomenc tool. The encoding +using the package in Debian Stable is quite slow, with the frame rate +for my 10 second test video at around 0.25 fps. My 10 second video +test took 16 minutes and 11 seconds on my test machine.

+ +

I tested by first running ffmpeg and then aomenc using the recipe +provided by the askubuntu recipe above. I had to remove the +'--row-mt=1' option, as it was not supported in my 1.0.0 version. The +encoding only used a single thread, according to top.

+ +
+ffmpeg -i some-old-video.ogv -t 10 -pix_fmt yuv420p video.y4m
+aomenc --fps=24/1 -u 0 --codec=av1 --target-bitrate=1000 \
+  --lag-in-frames=25 --auto-alt-ref=1 -t 24 --cpu-used=8 \
+  --tile-columns=2 --tile-rows=2 -o output.webm video.y4m
+
+ +

As version 1.0.0 currently have several +unsolved +security issues in Debian Stable, and to see if the recent +backport provided in +Debian is any quicker, I ran apt -t bullseye-backports install +aom-tools to fetch the backported version and re-encoded the +video using the latest version. This time the '--row-mt=1' option +worked, and the encoding was done in 46 seconds with a frame rate of +around 5.22 fps. This time it seem to be using all my four cores to +encode. Encoding speed is still too low for streaming and real time, +which would require frame rates above 25 fps, but might be good enough +for offline encoding.

+ +

I am very happy to see AV1 playback working so well with the +default tools in Debian Stable. I hope the encoding situation improve +too, allowing even a slow old computer like my 10 year old laptop to +be used for encoding.

+ +

As usual, if you use Bitcoin and want to show your support of my +activities, please send Bitcoin donations to my address +15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b.