mpv
                                
                                
                                
                                    mpv copied to clipboard
                            
                            
                            
                        Renoir APU - vo-gpu_hwdec-vaapi no HW acceleration / vo-vaapi_hwdec-vaapi results in very selective playback and crashes
Important Information
Provide following Information:
- mpv version
 
mpv 0.33.1 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects built on UNKNOWN FFmpeg library versions: libavutil 56.70.100 libavcodec 58.134.100 libavformat 58.76.100 libswscale 5.9.100 libavfilter 7.110.100 libswresample 3.9.100 FFmpeg version: 4.4-6ubuntu5
- Linux Distribution and Version
 
Linux 5.13.0-20-generic Ubuntu SMP x86_64 GNU/Linux
- Source of the mpv binary
 
Kubuntu repos
- If known which version of mpv introduced the problem
 - Window Manager and version
 
KDE Plasma 5.22.5
- GPU driver and version
 
AMD Ryzen 7 4750G APU, Radeon Vega 8 iGPU libva info: VA-API version 1.12.0 libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so libva info: Found init function __vaDriverInit_1_12 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.12 (libva 2.10.0) vainfo: Driver version: Mesa Gallium driver 21.2.2 for AMD RENOIR (DRM 3.41.0, 5.13.0-20-generic, LLVM 12.0.1) vainfo: Supported profile and entrypoints VAProfileMPEG2Simple : VAEntrypointVLD VAProfileMPEG2Main : VAEntrypointVLD VAProfileVC1Simple : VAEntrypointVLD VAProfileVC1Main : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice VAProfileH264Main : VAEntrypointVLD VAProfileH264Main : VAEntrypointEncSlice VAProfileH264High : VAEntrypointVLD VAProfileH264High : VAEntrypointEncSlice VAProfileHEVCMain : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointEncSlice VAProfileHEVCMain10 : VAEntrypointVLD VAProfileHEVCMain10 : VAEntrypointEncSlice VAProfileJPEGBaseline : VAEntrypointVLD VAProfileVP9Profile0 : VAEntrypointVLD VAProfileVP9Profile2 : VAEntrypointVLD VAProfileNone : VAEntrypointVideoProc
- Possible screenshot or video of visual glitches
 
Reproduction steps
So I have some 4k50p Panasonic footage that looked a bit washed out upon playback using the following mpv.conf options, as well as dropped frames and CPU load during playback, which should not happen.
vo=anything except xv or vaapi hwdec=vaapi-copy or vaapi profile=gpu-hq
Changing the config to
vo=vaapi hwdec=vaapi profile=gpu-hq
Resulted in correct playback for that particular footage (codec info attached), good color rendering and low CPU usage. However, any other h264 footage (codec info attached from a Fuji camera) I tried to play back resulted in a crash. Further testing showed that i can get correct color rendering, playback of all files but not HW acceleration using:
vo=xv hwdec=vaapi profile=gpu-hq
Expected behavior
HW acceleration of all h264 content and correct color rendering
Actual behavior
Broken playback, wrong color rendering, HW acceleration unused, or a combination thereof. Playback quality comparison attached
Log file
mpv_codec_info_fuji.txt mpv_panasonic_codec_info.txt mpv_vo-gpu_hwdec-vaapi_droppedframes_washedoutcolors.txt mpv_vo-vaapi_hwdec-vaapi_crash_fujifootage.txt mpv_vo-vaapi_hwdec-vaapi_goodplayback_lowcpu_panasonicfootage.txt mpv_vo-xv_hwdec-vaapi_goodplayback_highcpu.txt
Sample files
Sample files needed to reproduce this issue can be uploaded to https://0x0.st/ or similar sites. (Only needed if the issue cannot be reproduced without it.) Do not use garbage like "cloud storage", especially not Google Drive.
You're mixing and matching a lot of options here. First, profile=gpu-hq will do absolutely nothing with anything that isn't vo=gpu. Second, xv has no hwdec, it's a software only vo and therefore no hwdec is expected and normal. Third, you are describing possibly 3 separate issues here, and potentially none of them are related.
- You cannot use hwdec with 
--vo=gpu --hwdec=vaapi, that's a bug but could be related to driver issues - You have incorrect colors using 
--vo=gpu. This could also be driver related but because you're using--profile=gpu-hqit may be some options in there. vo=vaapiis crashing. ~~Are you using wayland with Plasma? There are some known issues withvo=vaapiand wayland.~~ Just realized the--vo=gpulogs do confirm Xorg.
Issue is still reproducible with Ubuntu 22.04 in-box mpv. Player crashes whenever setting "--vo=vaapi"
- mpv --vo=gpu --hwdec=vaapi 1080P_Video.264 --> PASS
 - mpv --vo=vaapi --hwdec=vaapi 1080P_Video.264 --> FAIL, mpv player crash.
 
$ mpv --vo=vaapi --hwdec=vaapi Desktop/clips/bbc_1080p.264 [lavf] This format is marked by FFmpeg as having no timestamps! [lavf] FFmpeg will likely make up its own broken timestamps. For [lavf] video streams you can correct this with: [lavf] --no-correct-pts --fps=VALUE [lavf] with VALUE being the real framerate of the stream. You can [lavf] expect seeking and buffering estimation to be generally [lavf] broken as well. (+) Video --vid=1 (h264 1920x1080 25.000fps) [vo/vaapi] Warning: this compatibility VO is low quality and may have issues with OSD, scaling, screenshots and more. [vo/vaapi] vo=gpu is the preferred choice in any case and includes VA-API support via hwdec=vaapi or vaapi-copy. Using hardware decoding (vaapi). No video PTS! Making something up. Using 25.000000 FPS. No video PTS! Making something up. Using 25.000000 FPS. Ignoring further missing PTS warnings. VO: [vaapi] 1920x1080 vaapi[nv12] mpv: malloc.c:2617: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed. Aborted (core dumped)
Lots of mixed up things in here so closing for now. Feel free to make a new issue if one of these problems still exists (--vo=vaapi works fine here for whatever it's worth).