mpv-player / mpv-player/mpv

Applying hwdec in a profile-cond profile doesn't work

Open
#16,233 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

os:linux
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

mpv Information
mpv v0.40.0-dirty Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
 built on Apr  4 2025 07:28:54
libplacebo version: v7.349.0
FFmpeg version: n7.1
FFmpeg library versions:
   libavcodec      61.19.100
   libavdevice     61.3.100
   libavfilter     10.4.100
   libavformat     61.7.100
   libavutil       59.39.100
   libswresample   5.3.100
   libswscale      8.3.100
Other Information
- Linux version: archlinux
- Kernel Version: 6.14.1-arch1-1
- GPU Model: radeon 7800 xt
- Mesa/GPU Driver Version: mesa 1:25.0.3-1
- Window Manager and Version: plasma kwin 6.3.4-3 wayland
- Source of mpv: arch repo
- Latest known working version: haven't tried
- Issue started after the following happened: youtube sometimes giving 4K videos in av1
Reproduction Steps

In trying to work around an issue where if a 4K AV1 video is tried to be played, I'd just be left with a purple window and errors about the surface being too big, I tried to create a conditional profile to detect those constraints and disable hwdec. I created a minmal config file to try to reproduce the issue:

# Write your default config options here!

vo=gpu-next
hwdec=auto

[no-4k-hwdec]
profile-cond=(width > 2560 or height > 2560) and get("current-tracks/video/codec") == "av1"
profile-restore=copy
hwdec=no

and tried again to play the file.

Expected Behavior

hwdec being disabled and encoding in software.

Actual Behavior

In the log it looks like it tries to switch to software, but then says it's still trying to use vaapi? Still displays a purple window.

Log File

hwdec.txt

Sample Files

No response

I carefully read all instruction and confirm that I did the following:
  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached hwdec.txt log and the minimal profile-cond configuration in the issue, focusing on the profile-restore and hwdec transitions. Trace the relevant profile and hardware-decoding entry points, then verify that matching the AV1 and resolution condition results in software decoding without continued VAAPI use or a purple window.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
computer-graphics, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.