mpv-player / mpv

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

Higher GPU usage in recent versions (e969072, 78719c1, 78d4374) #12648

Closed Tsuchimikado closed 1 year ago

Tsuchimikado commented 1 year ago

Important Information

Reproduction steps

Download mpv version e969072, 78719c1, 78d4374. Play any video.

Expected behavior

GPU usage is normal.

Actual behavior

GPU usage is high 40-50% for 1080p30fps, 80-90% for 1080p60fps without hardware decoding. 4K60fps constantly dropping frames with hardware decoding.

Log file

Created with parameters --no-config --hwdec=auto --mute using 4K60fps test file. output_230917_181eddc.txt output_231001_e969072.txt output_231008_78719c1.txt output_231015_78d4374.txt

llyyr commented 1 year ago

The default options were changed by #12384 to be higher quality. To get back the old low quality defaults, use --profile=fast

Jules-A commented 1 year ago

Expected behavior: https://github.com/mpv-player/mpv/pull/12384

Weaker machines need to use profile=fast

While I don't really agree with the defaults over something like --scale=cosine --cscale=hamming which is like 3x faster than lanczos while looking close (imo, not as sharp but doesn't suffer from artifacts, --scale=catmull_rom --scale-param1=0.1 --scale-param2=0.45 if you need the sharpness), lanczos won by popularity. If you are still lagging at 4k then it might be the downscaling change also.

kasper93 commented 1 year ago

GPU usage is high 40-50% for 1080p30fps, 80-90% for 1080p60fps without hardware decoding. 4K60fps constantly dropping frames with hardware decoding.

Like mentioned already, after recent changes, default mpv settings are tuned to be balanced between quality and performance. As opposed to previous defaults, which were fully performance focused. New profile exists --profile=fast as a base to maximize performance with recent mpv versions.

For the most part new defaults should work ok for most content even on weaker iGPU. But of course as you noticed Intel iGPU for 4k60 may be tricky. For native displaying it would be fine, but depending on downscaling it may be too slow.

You can try --vo=gpu-next and --gpu-api=vulkan with default profile. Especially for 4k60 file when you downscale to 1459x821 it should be a lot faster, because hermite downscaling is very optimized on gpu-next and not really on gpu.

I'm actually curious if you could see the difference between gpu and gpu-next on your hardware. You can take a look at stats page 2 (shift+i and 2 key to access it) to see rendering times and of course gpu usage is also good metric.

sfan5 commented 1 year ago

Working as intended.

Tsuchimikado commented 1 year ago

--vo=gpu-next and --gpu-api=vulkan with default profile

does not really change anything, maybe my hardware is too weak

I'm actually curious if you could see the difference between gpu and gpu-next on your hardware

gpu-next uses about 5% more cpu and 2% more gpu https://i.imgur.com/z5IOWrT.jpg

use --profile=fast

thank you, this fixed the high gpu usage issue

The default options were changed by #12384 to be higher quality

default mpv settings are tuned to be balanced between quality and performance

I am sorry but there is no significant difference between new default and fast profiles comparison https://imgur.com/a/rIqks82 source https://www.youtube.com/watch?v=QI96hnhcr2E (1080p VP9) new default profile uses as much gpu as madvr but resulting image is same with fast profile (a little bit blurrier in my opinion)

Vamp898 commented 6 months ago

@Tsuchimikado to be fair, the sample video has very low image quality to begin with. You need higher quality material to see the difference so yes, in your case, it doesn't matter if you use fast, default or high-quality.

YouTube 1080p 1mbps avg (~5mbps peak) YouTube 1080p Premium 1.5mbps avg (~6mbps peak) YouTube 4K: 12mbps avg (~55mbps peak)

For comparison, BluRay 1080p 30mbps avg (~40mbps peak) BluRay 4K 100mbps avg (~140mbps peak)

So if you're watching mostly youtube, set profile=fast in your mpv.conf and be done.