Page 1 of 1
mpv and ffmpeg cannot play AV1 videos
Posted: Mon Mar 31, 2025 6:18 am
by SteveS
To save energy and bandwidth with yt-dlp (or youtube-dl), I use the following line in my mpv configuration file located at ~/.config/mpv/mpv.conf
:
Code: Select all
ytdl-format="bestvideo[height<=?720][fps<=?30][vcodec!~='vp0?9']+bestaudio/best"
Unlike a large TV screen, I find that a PC monitor doesn't necessarily need to play heavier VP9 YouTube videos above 720p. Smaller AV1 alternatives are sufficient.
However, the issue is that by avoiding VP9 videos, mpv often cannot play any lighter alternative of a video encoded in AV1, giving this error message:
Code: Select all
[ffmpeg/video] av1: Your platform doesn't support hardware accelerated AV1 decoding.
[ffmpeg/video] av1: Failed to get pixel format.
Error while decoding frame!
[ffmpeg/video] av1: Missing Sequence Header.
Error while decoding frame!
(in the terminal, press 'Ctrl+c' to stop the repeating message and return to the prompt)
The truth is that this is not a hardware issue but a software one. It's simply that our version of ffmpeg does not support AV1 decoding.
Possible solutions:
1. As seen here: https://stackoverflow.com/a/70829069 we can install a ffmpeg build with support of an AV1 decoder such as libdav1d
. Available at: https://johnvansickle.com/ffmpeg/
or:
2. As stated here: https://trac.ffmpeg.org/wiki/Compilatio ... u#libdav1d we can install libdav1d-dev
and configure ffmpeg with:
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Mon Mar 31, 2025 10:19 am
by BarryK
Is this Easy Scarthgap or Daedalus?
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Tue Apr 01, 2025 12:50 am
by SteveS
EasyOS Scarthgap.
Here are the steps to reproduce:
1. Create the mpv.conf
file. To create mine:
then:
Code: Select all
tee /root/.config/mpv/mpv.conf <<EOF
# Video format/quality that is directly passed to yt-dlp
# yt-dlp: https://github.com/yt-dlp/yt-dlp
ytdl-format="bestvideo[height<=?720][fps<=?30][vcodec!~='vp0?9']+bestaudio/best"
# If using yt-dlp, you can add this script:
# mpv_sponsorblock_minimal: https://codeberg.org/jouni/mpv_sponsorblock_minimal
# Start in fullscreen mode by default
fs=yes
# Create a video output window even if there is no video
force-window=yes
EOF
2. Install yt-dlp:
Code: Select all
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
then:
3. Open a YouTube video encoded in VP9 and AV1 by typing the corresponding mpv command in the terminal.
For more privacy and no ads at all, we will use an Invidious instance (instead of the YouTube site) searching for example: "Linux on Asus Zenbook S 13".
We get this page of results: https://yewtu.be/search?q=Linux+on+Asus ... sort=views
Let's try playing this video entitled "Thin.... but not dumb! - ASUS Zenbook S 13 OLED":
Code: Select all
mpv https://yewtu.be/watch?v=tXWebwlfqfc
The video cannot be played at all in my case and I have to press 'Ctrl+c' to stop the repeating error messages and return to the prompt.
And of course, same result with the corresponding YouTube link:
Code: Select all
mpv https://www.youtube.com/watch?v=tXWebwlfqfc
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Wed Apr 02, 2025 5:53 pm
by Jasper
@SteveS
I was intrigued at your post and thought of possible alternative method of playback.
This has only been tested with Fossapup95 using the BBC Iplayer as the source.
Using yt-dlp for your links, I am informed that it is 'throttled' and therefore unable to playback.
So, I ended up using the BBC Iplayer service instead.
I am using FFMPeg and MPV.

Using yt-dlp I listed the formats that were available to me and then choose an AV1 file for playback.
As you see in my command it is then piped to mpv for immediate playback.


Re: mpv and ffmpeg cannot play AV1 videos
Posted: Thu Apr 03, 2025 3:04 am
by SteveS
@Jasper
Thank you for your research.
What you found with the BBC seems interesting, so I wanted to test it myself.
Here is my MPV:

And FFmpeg:

I tried to find BBC iPlayer video streams... except that the service is not available outside the UK:

So I searched for direct links to BBC videos without going through the BBC website and found this, for example:

With yt-dlp I tried to list the formats that were available, but my geolocation prevents me from doing so:

And for the same reasons, I couldn't open the video either:

As a result, I couldn't verify any BBC AV1 videos.
Life is unfair sometimes...
For anyone interested,
Here are 2 sites offering AV1 test videos:
https://av1.webmfiles.org/
https://test-videos.co.uk/sintel/mp4-av1
In my case with EasyOS, even though sometimes the audio may work, the videos won't play.
Alternative methods for streaming videos from the terminal, without consuming the resources of a web browser, could deserve a topic of their own, but I doubt the subject would interest normal people.
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Thu Apr 03, 2025 7:05 am
by Jasper
@SteveS
For you desired link, there is no need for the text description eg
Code: Select all
https://www.bbc.co.uk/iplayer/episode/m0009tt8
Here are the formats for the link you provided:
https://i.postimg.cc/kGw5yzgz/1.webp
https://i.postimg.cc/GpRZc2QP/2.webp
https://i.postimg.cc/9QBjwZzg/3.webp
https://i.postimg.cc/kGWH3PbY/4.webp
https://i.postimg.cc/T33tQDC4/5.webp
Have you attempted to use the GeoBypass option?
https://yt-dlp.memoryview.in/docs/advan ... -in-yt-dlp
If you use the 'verbose' command it will give you detailed information.
Code: Select all
yt-dlp --verbose --list-formats https://www.bbc.co.uk/iplayer/episode/m0009tt8
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Thu Apr 03, 2025 7:30 am
by Jasper
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Thu Apr 03, 2025 1:11 pm
by bugnaw333
@Jasper
No audio on EasyOS Daedalus. 
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Thu Apr 03, 2025 1:44 pm
by Jasper
@bugnaw333
I am not familiar with the OS setup.
One of the files that I viewed on that website using LibreWolf-136.0.4-1 shows me the video with audio playback.
http://temp.sh/rowjc/LibreWolf-136.0.4-1.sfs
My animation files are GIF's, so a little slow in playback with no audio.
https://i.postimg.cc/cC1g0yD4/librewolf.gif
I did download the file and played it using mpv.
Code: Select all
wget https://dl6.webmfiles.org/BigBuckBunny-AV1.webm
Fossapup95 uses ALSA for audio.
https://i.postimg.cc/FzKB5wmj/reduced.gif
Could it be an issue that you do not have LibOpus ?
AV1-video-OPUS-audio.webp
This should be available in FFMpeg.
Have you tried playback using an alternative media player like VLC?
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Fri Apr 04, 2025 4:40 am
by SteveS
Thanks again @Jasper
In the links for the BBC video, in the VCODEC column I see the formats 'avc3' and 'avc1' listed.
If I'm not mistaken, AVC1 and AVC3 videos are not AV1 encoded. They are formats of the H.264/AVC codec, which is a different video compression standard.
AV1 is a newer codec designed to provide better compression efficiency than H.264/AVC or even H.265/HEVC. AV1 belongs to a different family of codecs.
There really is enough to get lost in all of this!
and
To be honest, I hadn't thought about all of that at the time, but I confirm that yt-dlp --geo-bypass https://www.bbc.co.uk/iplayer/episode/m0009tt8
and yt-dlp --geo-bypass-country UK https://www.bbc.co.uk/iplayer/episode/m0009tt8
don't work either (same error as before).
But apparently, people seem to really struggle with the BBC geo-ip filtering since the era of youtube-dl in 2020:
https://www.linuxquestions.org/question ... 175680199/
Then I remembered having already seen the 'avc1' format (like for the BBC video) almost every time I've listed YouTube video formats...
Time for a new test:
Let's take this video https://www.youtube.com/watch?v=9bZkp7q19f0
having 'vp09', 'av01', 'vp9' and 'avc1'.
To force the 'avc1' format only (to play H.264 encoded video) I replaced in my mpv.conf
file this line:
Code: Select all
ytdl-format="bestvideo[height<=?720][fps<=?30][vcodec!~='vp0?9']+bestaudio/best"
with this one:
Code: Select all
ytdl-format="bestvideo[height<=?720][fps<=?30][vcodec~='^(avc|h264)']+bestaudio/best"
I found inspiration here:
https://github.com/yt-dlp/yt-dlp/issues ... 1821393561
Then I ran the command:
Code: Select all
mpv https://www.youtube.com/watch?v=9bZkp7q19f0
Result:
It works.
EasyOS Scarthgap can stream AVC1 videos (H.264/AVC codec) without issue.
But not videos with AV1 codec.
For that, we still need to compile FFmpeg with libdav1d
or install libdav1d-dev
and configure FFmpeg with:
All this perhaps explains why BBC iPlayer videos might work out-of-the-box.
bugnaw333 wrote: Thu Apr 03, 2025 1:11 pm
@Jasper
No audio on EasyOS Daedalus. 
For me it's the opposite:
Audio ok but no video on EasyOS Scarthgap 
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Fri Apr 04, 2025 8:49 am
by N97
As a recent build check is in order at this point...
libdav1d is version 7.0.0
You may also need libSvtAv1Enc which is at version 2.2.0
VoidPup64-100924 has these exact files
and mpv is at version 0.39.0
Regards
N97
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Fri Apr 04, 2025 10:34 am
by Jasper
@SteveS
Do you want to create a 'new' topic in the Multimedia section?
I was about to share some more information that you might find useful and decided not to as is generic in nature and I am mindful this is the EasyOS section.
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Fri Apr 04, 2025 8:37 pm
by don570

- Screenshot 2025-04-04 16.33.51.png (13.08 KiB) Viewed 392 times
When I download with my Dell Chromebook using Chrome OS
I don't hear any audio with the video
_________________________________________
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Fri Apr 04, 2025 11:07 pm
by bugnaw333
Still no audio on Mercury, Chrome, and Opera browsers.
@Jasper
LibOpus is already installed in EasyOS by default. 
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Fri Apr 04, 2025 11:37 pm
by bugnaw333
@Jasper
for MPV and Celluloid:
1. BigBuck Bunny--video&Audio OK.
2. BeachYoga--video OK but no audio
3. BeachDrone--video OK but no audio
for VLC version 3.0.21:
1. BigBuck Bunny-- with audio but no video
2. BeachYoga and BeachDrone--will play but no display and no audio, black screen.
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Sat Apr 05, 2025 12:56 am
by SteveS
Jasper wrote: Fri Apr 04, 2025 10:34 am
@SteveS
Do you want to create a 'new' topic in the Multimedia section?
I was about to share some more information that you might find useful and decided not to as is generic in nature and I am mindful this is the EasyOS section.
No problem, you can create a new topic there and share the link here!
I'm certain you could teach us a lot of interesting things, and I also think other members of the forum might appreciate it.
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Sat Apr 05, 2025 7:32 am
by Jasper
@bugnaw333
The files provided are a combination of "video (only)" and "video and audio"
https://av1.webmfiles.org/
Which is why you get different results with your media player.
For example this 1920x1080 sample file is "video only"
https://i.postimg.cc/fLnr3PCR/Screensho ... 82329.webp
Personally, I do not have issues with my older setup:
https://i.postimg.cc/13CQ9qNj/Screensho ... 81322.webp
Re: mpv and ffmpeg cannot play AV1 videos
Posted: Sat Apr 05, 2025 8:45 am
by Jasper
SVT1Enc is an 'encoder' only.
https://i.postimg.cc/qMT65c7V/Screensho ... 92858.webp
When compiling it will use cpuinfo to find out which instructions your processor it capable eg SSE.
It is cpu intensive.
A better option would be to purchase and use a dedicated graphics card which utilises VA-API.
Libdav1d is a 'decoder' (VLC)
https://i.postimg.cc/4xFfgz3L/Screensho ... 03347.webp