mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.66k stars 2.93k forks source link

VAAPI Hardware decoding is not used for DVB streams that contain errors #15351

Closed madmanxxx closed 16 hours ago

madmanxxx commented 16 hours ago

mpv Information

mpv v0.39.0 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Nov  6 2024 17:31:17
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: Arch Linux
- Kernel Version: Linux arte460 6.11.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 17 Nov 2024 16:06:17 +0000 x86_64 GNU/Linux
- GPU Model: 00:02.0 VGA compatible controller [0300]: Intel Corporation Alder Lake-P GT2 [Iris Xe Graphics] [8086:46a6] (rev 0c)
- Mesa/GPU Driver Version: OpenGL version string: 4.6 (Compatibility Profile) Mesa 24.2.7-arch1.1
- Window Manager and Version: LXQt (X11/Openbox and Wayland/Sway)
- Source of mpv: distro package (https://archlinux.org/packages/extra/x86_64/mpv/)
- Latest known working version: unknown
- Issue started after the following happened: maybe always, just noticed it recently

Reproduction Steps

For convenience, you may use the following one-liner mpv --hwdec=vaapi https://timobai.pl/videos/sample.ts

The file is a few seconds dump of a DVB-T2 (H265) stream, served by Tvheadend. It may also be downloaded and played locally with the same effect.

Expected Behavior

Hardware acceleration (VAAPI in my case) should be used.

Actual Behavior

Software decoding is used, which manifests itself by:

Hardware decoding can still be turned on by pressing Ctrl+H twice, but not always, I would say in 80 % of cases. The provided log file is from a run, where Ctrl+H was pressed twice a few seconds after the playback started. Successful activation of hardware acceleration causes CPU usage drop and the above message appears in the console.

If I convert this sample with FFMPEG without transcoding, MPV will enable hardware decoding right from the beginning. It's like MPV gives up hardware decoding after 3 unsuccessful tries.

Log File

mpv-software-decoding.log

Sample Files

https://timobai.pl/videos/sample.ts

I carefully read all instruction and confirm that I did the following:

CounterPillow commented 16 hours ago

This is intended, see --vd-lavc-software-fallback to control this behaviour.

madmanxxx commented 16 hours ago

Well, setting --vd-lavc-software-fallback=25 solved the problem in my case.

Interesting option, I would NEVER have guessed it exists, even considering the amount of options MPV has...

That settles the issue I guess... Closing.