MPV: issues with the new release

I seem to have some issues with the newly released MPV. I am not sure if it has to do with MPV or ffmpeg. Or is it something not properly configured on my system? It seems the hardware decoding is not working? I didn’t have this issue before the update.
Please have a look at the output from the terminal.

This is on a system with AMD cpu-igpu

inxi -CG

CPU:
  Info: 8-core model: AMD Ryzen 7 4800U with Radeon Graphics bits: 64
    type: MT MCP cache: L2: 4 MiB
  Speed (MHz): avg: 1400 min/max: 1400/1800 cores: 1: 1400 2: 1400 3: 1400
    4: 1400 5: 1400 6: 1400 7: 1400 8: 1400 9: 1400 10: 1400 11: 1400 12: 1400
    13: 1400 14: 1400 15: 1400 16: 1400
Graphics:
  Device-1: Advanced Micro Devices [AMD/ATI] Renoir [Radeon Vega Series /
    Radeon Mobile Series] driver: amdgpu v: kernel
  Display: wayland server: X.org v: 1.21.1.16 with: Xwayland v: 24.1.6
    compositor: gnome-shell v: 48.0 driver: X: loaded: modesetting dri: radeonsi
    gpu: amdgpu resolution: no compositor data resolution: 1920x1080
  API: EGL v: 1.5 drivers: kms_swrast,radeonsi,swrast
    platforms: gbm,wayland,x11,surfaceless,device
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 25.0.2-arch1.2
    renderer: AMD Radeon Graphics (radeonsi renoir ACO DRM 3.61 6.14.0-arch1-1)
  Info: Tools: api: eglinfo,glxinfo x11: xprop

$ mpv https://www.youtube.com/watch?v=2Ky0_WrdNSU
● Video  --vid=1               (av1 3840x2160 25 fps) [default]
● Audio  --aid=1  --alang=eng  (opus 2ch 48000 Hz) [default]
File tags:
 Date: 20250302
 Uploader: Tatiana Hopper
 Channel_URL: https://www.youtube.com/channel/UCuuvwU8Fv1O2h3IqHtXtCRQ
Cannot load libcuda.so.1
[ffmpeg/video] av1: No support for codec av1 profile 0.
[ffmpeg/video] av1: Your platform doesn't support hardware accelerated AV1 decoding.
[ffmpeg/video] av1: Failed to get pixel format.
[ffmpeg/video] av1: Get current frame error
Error while decoding frame (hardware decoding)!
[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
[ffmpeg/video] av1: No support for codec av1 profile 0.
[ffmpeg/video] av1: Failed setup for format vaapi: hwaccel initialisation returned error.
[ffmpeg/video] av1: Your platform doesn't support hardware accelerated AV1 decoding.
[ffmpeg/video] av1: Failed to get pixel format.
[ffmpeg/video] av1: Get current frame error
Error while decoding frame (hardware decoding)!
[ffmpeg] AVHWDeviceContext: Instance creation failure: VK_ERROR_INCOMPATIBLE_DRIVER
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
AO: [pipewire] 48000Hz stereo 2ch floatp
VO: [gpu] 3840x2160 yuv420p
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: Packet corrupt (stream = 0, dts = 439808).
[ffmpeg] NULL: Invalid OBU length: 43631, but only 29640 bytes remaining in fragment.
[ffmpeg] NULL: Failed to parse temporal unit.
AV: 00:00:20 / 00:12:48 (3%) A-V:  0.000 Cache: 13s/7MB
Exiting... (Quit)

Is someone else having this issue? Appreciate some help to solve this problem.

Your GPU doesn’t support AV1 hardware decoding. You have to select a different codec/format.

Working fine for me on my Desktop

Graphics:
  Device-1: Advanced Micro Devices [AMD/ATI] Renoir [Radeon Vega Series /
    Radeon Mobile Series] vendor: Hewlett-Packard driver: amdgpu v: kernel
    arch: GCN-5 code: Vega process: GF 14nm built: 2017-20 pcie: gen: 3
    speed: 8 GT/s lanes: 16 ports: active: DP-1 empty: HDMI-A-1
    bus-ID: 0c:00.0 chip-ID: 1002:1636 class-ID: 0300 temp: 33.0 C
  Display: x11 server: X.Org v: 21.1.16 compositor: Picom v: 12.5 driver: X:
    loaded: amdgpu unloaded: modesetting alternate: fbdev,vesa dri: radeonsi
    gpu: amdgpu display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
    s-diag: 582mm (22.93")
  Monitor-1: DP-1 mapped: DisplayPort-0 model: Acer P244W
    serial: LEB0D0068500 built: 2009 res: mode: 1920x1080 hz: 60 scale: 100% (1)
    dpi: 92 gamma: 1.2 size: 531x299mm (20.91x11.77") diag: 609mm (24")
    ratio: 16:9 modes: max: 1920x1080 min: 720x400
  API: EGL v: 1.5 hw: drv: amd radeonsi platforms: device: 0 drv: radeonsi
    device: 1 drv: swrast gbm: drv: kms_swrast surfaceless: drv: radeonsi x11:
    drv: radeonsi inactive: wayland
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 25.0.2-arch1.2
    glx-v: 1.4 direct-render: yes renderer: AMD Radeon Graphics (radeonsi
    renoir ACO DRM 3.61 6.13.8-arch1-1) device-ID: 1002:1636 memory: 500 MiB
    unified: no
  Info: Tools: api: eglinfo,glxinfo de: xfce4-display-settings
    x11: xdpyinfo, xprop, xrandr

never mind I just looked at my mpv.conf I didnt enable hardware decoding so it may not work will test brb

Not sure.

    13: 1400 14: 1400 15: 1400 16: 1400
Graphics:
  Device-1: Advanced Micro Devices [AMD/ATI] Renoir [Radeon Vega Series /
    Radeon Mobile Series] driver: amdgpu v: kernel

Seems to be the same as @thefrog’s?

Mine is:

inxi -Ga

Graphics:
  Device-1: Advanced Micro Devices [AMD/ATI] Renoir [Radeon Vega Series /
    Radeon Mobile Series] vendor: Lenovo driver: amdgpu v: kernel arch: GCN-5
    code: Vega process: GF 14nm built: 2017-20 pcie: gen: 3 speed: 8 GT/s
    lanes: 16 ports: active: eDP-1 empty: DP-1,HDMI-A-1 bus-ID: 04:00.0
    chip-ID: 1002:1636 class-ID: 0300 temp: 42.0 C
  Display: wayland server: X.org v: 1.21.1.16 with: Xwayland v: 24.1.6
    compositor: gnome-shell v: 48.0 driver: X: loaded: modesetting
    alternate: fbdev,vesa dri: radeonsi gpu: amdgpu display-ID: 0
  Monitor-1: eDP-1 model: Lenovo 0x889a built: 2019 res: 1920x1080 dpi: 158
    gamma: 1.2 size: 309x174mm (12.17x6.85") diag: 355mm (14") ratio: 16:9
    modes: max: 1920x1080 min: 640x480
  API: EGL v: 1.5 hw: drv: amd radeonsi platforms: device: 0 drv: radeonsi
    device: 1 drv: swrast gbm: drv: kms_swrast surfaceless: drv: radeonsi
    wayland: drv: radeonsi x11: drv: radeonsi
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 25.0.2-arch1.2
    glx-v: 1.4 direct-render: yes renderer: AMD Radeon Graphics (radeonsi
    renoir ACO DRM 3.61 6.14.0-arch1-1) device-ID: 1002:1636 memory: 500 MiB
    unified: no display-ID: :0.0
  Info: Tools: api: eglinfo,glxinfo x11: xprop

But they play a VP9 stream while you are playing an AV1 video. You also have to select a VP9 or h.264 stream. You can select a format for yt-dlp and pass those arguments through mpv.

1 Like

ok so even with hardware decode enabled it works for me still. maybe try again. :man_shrugging:

I don’t know how that works. Is it with yt-dlp -F url that I can see the formats?

Here is a copy of my MPV.conf file maybe a setting is different that works for me?

##################
# video settings #
##################

# Start in fullscreen mode by default.
#fs=yes

# force starting with centered window
geometry=50%:50%

# don't allow a new window to have a size larger than 80% of the screen size
autofit-larger=80%x80%

# Specify fast video rendering preset (for --vo=<gpu|gpu-next> only)
# Recommended for mobile devices or older hardware with limited processing power
#profile=fast

# Specify high quality video rendering preset (for --vo=<gpu|gpu-next> only)
# Offers superior image fidelity and visual quality for an enhanced viewing
# experience on capable hardware
profile=high-quality

# Force video to lock on the display's refresh rate, and change video and audio
# speed to some degree to ensure synchronous playback - can cause problems
# with some drivers and desktop environments.
#video-sync=display-resample

# Enable hardware decoding if available. Often, this does not work with all
# video outputs, but should work well with default settings on most systems.
# If performance or energy usage is an issue, forcing the vdpau or vaapi VOs
# may or may not help.
hwdec=auto

##################
# audio settings #
##################
#Volume
volume=45
volume-max=300

# Specify default audio device. You can list devices with: --audio-device=help
# The option takes the device string (the stuff between the '...').
#audio-device=alsa/default

# Do not filter audio to keep pitch when changing playback speed.
#audio-pitch-correction=no

# Output 5.1 audio natively, and upmix/downmix audio with a different format.
#audio-channels=5.1
# Disable any automatic remix, _if_ the audio output accepts the audio format.
# of the currently played file. See caveats mentioned in the manpage.
# (The default is "auto-safe", see manpage.)
#audio-channels=auto


##################
# other settings #
##################

# Display English subtitles if available.
slang=en

# Play Finnish audio if available, fall back to English otherwise.
alang=en

#resize window to video size?
auto-window-resize=no

#save the place of the current video if stopped
save-position-on-quit

screenshot-directory=/home/thefrog/tmp/Pictures/mpv/
screenshot-format=png

# Pretend to be a web browser. Might fix playback with some streaming sites,
# but also will break with shoutcast streams.
#user-agent="Mozilla/5.0"

# cache settings
#
# Use a large seekable RAM cache even for local input.
cache=yes
#
# Use extra large RAM cache (needs cache=yes to make it useful).
demuxer-max-bytes=500M
demuxer-max-back-bytes=100M
#
# Disable the behavior that the player will pause if the cache goes below a
# certain fill size.
#cache-pause=no
#
# Store cache payload on the hard disk instead of in RAM. (This may negatively
# impact performance unless used for slow input such as network.)
#cache-dir=~/.cache/
#cache-on-disk=yes

# You can also include other configuration files.
#include=/path/to/the/file/you/want/to/include

############
# Profiles #
############

# The options declared as part of profiles override global default settings,
# but only take effect when the profile is active.

# The following profile can be enabled on the command line with: --profile=eye-cancer

#[eye-cancer]
#sharpen=5

I have only this in mpv.conf :sweat_smile:

1 Like

Yeah I Grabbed a copy of the basic config file about 3 months ago when I switched to mpv and just modified it for my needs.

1 Like

@Schlaefer is right about AV1 versus VP9 which is the video you are playing. That works for mae as well:

$ mpv https://www.youtube.com/watch?v=SGQg1L_ojm8
● Video  --vid=1  --vlang=eng  (vp9 1920x1080 60 fps) [default]
● Audio  --aid=1  --alang=eng  (opus 2ch 48000 Hz) [default]
File tags:
 Date: 20250323
 Uploader: DJ Ware
 Channel_URL: https://www.youtube.com/channel/UC05XpvbHZUQOfA6xk4dlmcw
Cannot load libcuda.so.1
Using hardware decoding (vaapi).
AO: [pipewire] 48000Hz stereo 2ch floatp
VO: [gpu] 1920x1080 vaapi[nv12]
AV: 00:03:00 / 00:05:50 (51%) A-V:  0.000 Dropped: 72 Cache: 170s/45MB

@thefrog
Would you be willing to test with an AV1 video to see if it works for you?

Here is a link to an “innocent” video. It’s about photography.

https://www.youtube.com/watch?v=ioJDriq9OIY

works fine

1 Like

Thanks!
We seems to have similar GPU. If it works for you, then it is something on my end :unamused_face:

I’m running Openbox if that helps. Seems the only diffrence in our Video is the Vendor

Don’t know. I am currently on GNOME but I have a KDE Plasma install as well on this machine.
I can boot that later and check.

Yes, it seems so.

Yeah it works for me with the hardware decoder either enabled or disabled.

1 Like

It will play fine, but just always using the software decoder. This GPU just doesn’t have AV1 hardware decoding.

@cactux Try this:

mpv --ytdl-raw-options=format=bestvideo[ext=webm] https://www.youtube.com/watch?v=ioJDriq9OIY

1 Like

Thanks @Schlaefer!
Looks like I get VP9 and hardware decoding though no audio this time :grinning_face_with_smiling_eyes:

Here is the output:

mpv --ytdl-raw-options=format=bestvideo[ext=webm] https://www.youtube.com/watch?v=ioJDriq9OIY
● Video  --vid=1  --vlang=eng  (vp9 3840x2160 25 fps) [default]
File tags:
 Date: 20250313
 Uploader: The Photographic Eye
 Channel_URL: https://www.youtube.com/channel/UCdQ2jU3p06eoXfrSWchHOrQ
Cannot load libcuda.so.1
Using hardware decoding (vaapi).
VO: [gpu] 3840x2160 vaapi[nv12]
V: 00:02:01 / 00:08:42 (23%) Cache: 103s/150MB
Exiting... (Quit)

Oh, forgot audio.

mpv --ytdl-raw-options=format=bestvideo[ext=webm]+bestaudio ...

You have to toy with format options to find something you want.

But looking into it I think this is the overall better solution:

mpv --ytdl-raw-options=compat-options=prefer-vp9-sort ...

You can also put that option without the -- into your mpv.conf.

1 Like

Both looks to be working fine!


● Video  --vid=1  --vlang=eng  (vp9 3840x2160 25 fps) [default]
● Audio  --aid=1  --alang=eng  (opus 2ch 48000 Hz) [default]
File tags:
 Date: 20250313
 Uploader: The Photographic Eye
 Channel_URL: https://www.youtube.com/channel/UCdQ2jU3p06eoXfrSWchHOrQ
Cannot load libcuda.so.1
Using hardware decoding (vaapi).
AO: [pipewire] 48000Hz stereo 2ch floatp
VO: [gpu] 3840x2160 vaapi[nv12]
AV: 00:00:51 / 00:08:42 (10%) A-V:  0.000 Cache: 44s/73MB
Exiting... (Quit)
● Video  --vid=1  --vlang=eng  (vp9 3840x2160 25 fps) [default]
● Audio  --aid=1  --alang=eng  (opus 2ch 48000 Hz) [default]
File tags:
 Date: 20250313
 Uploader: The Photographic Eye
 Channel_URL: https://www.youtube.com/channel/UCdQ2jU3p06eoXfrSWchHOrQ
Cannot load libcuda.so.1
Using hardware decoding (vaapi).
AO: [pipewire] 48000Hz stereo 2ch floatp
VO: [gpu] 3840x2160 vaapi[nv12]
AV: 00:00:46 / 00:08:42 (9%) A-V:  0.000 Cache: 41s/68MB

Yes, I should be looking into it. I know that both yt-dlp and mpv have endless options but I have never really dug into it.

I’ will do that. Will other applications like celluloid or smplayer read from mpv.conf as well?

It’s funny that I had never noticed before those error messages about AV1 hardware decoding not being available for this hardware.

Thank you so much @Schlaefer for helping me out with this! Much appreciated.
Thanks @thefrog too for hanging in there with me!

2 Likes