mpv-player / mpv

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

4k 60fps hdr video has a lot of dropped frames on full screen. #8621

Closed armodim closed 3 years ago

armodim commented 3 years ago

Reproduction steps

Play 4k 60fps hdr video with --hwdec=vaapi.

(With --no-config option there are twice more dropped frames and the CPU usage goes up to 50-60%.)

Expected behavior

No stuttering or choppy.

Actual behavior

Video is choppy and has a lot of dropped frames. But playing video in vlc has no any stuttering (there is another issue though - colors are very poor). Exiting full screen (downscale) or putting mpv to a FullHD monitor make video smooth.

Log file

Screenshot of Shift+i: https://0x0.st/-POo.png Screenshot of htop while playing video: https://0x0.st/-POZ.png Log-file: https://0x0.st/-PO8.txt

Sample files

For the tests I play downloaded file from this youtube video: https://www.youtube.com/watch?v=LXb3EKWsInQ

Dudemanguy commented 3 years ago

Mesa Intel(R) UHD Graphics 630

Isn't your GPU just underpowered? I don't know what settings you used for vlc but on my machine, the opengl output on vlc for this video is extremely choppy and drops a ton of frames for me. mpv works fine with the default (things get dicey if I start to use more advanced settings though).

Probably on your hardware, software scalers would for fine (like wlshm) but the colors will be awful since there is no tonemapping. Likely whatever you were doing with vlc was also using a software scaler (hence the poor colors).

Basically, vo=gpu is well, gpu-bound.

philipl commented 3 years ago

Yes, you can't do it. UHD 630 is only capable of doing 4k 24fps.

armodim commented 3 years ago

Yes, you can't do it. UHD 630 is only capable of doing 4k 24fps.

Yes if you use HDMI 1.4. But via DisplayPort it is ok. Besides it vlc playing it smooth, as i said. I guess the key of the problem is hdr. Have a look into my screenshot at the topic ( https://0x0.st/-POo.png ). There is Pixel Format:"p010" with Primaries: bt.2020. And 4k 60fps NO hdr video (for example https://www.youtube.com/watch?v=V5Fsj_sCKdg ) is playing smooth. Here the screenshot of it: https://0x0.st/-P4O.png As you can see, there is no drops. BUT the Pixel Format: nv12, Primaries: bt.709.

philipl commented 3 years ago

Sorr, let me be more specific. My point was that there isn't enough GPU power to do 4k60 HDR with a UHD 630. As @Dudemanguy discussed, there isn't enough GPU power to do the tonemapping.

armodim commented 3 years ago

Isn't your GPU just underpowered?

CPU is not loaded at all. 12-20%. And it's cold, the fans keep silence as well. I could say there is no any difference against idle system.

Dudemanguy commented 3 years ago

CPU is not loaded at all

I said GPU. You need a better GPU if you want to do tonemapping at 4k60. Whatever you were doing in vlc had no tonemapping which is why you had bad colors.

armodim commented 3 years ago

CPU is not loaded at all

I said GPU.

GPU integrated into a CPU. So if the gpu is overloaded, htop would show this. Init?

Dudemanguy commented 3 years ago

So if the gpu is overloaded, htop would show this.

I'm fairly certain it wouldn't. I'm pretty sure the iGPU has no effect on the CPU aside from perhaps like RAM/memory usage. You would need some other dedicated tool if you want to measure it. Anyways, closing this since it is a hardware issue (not powerful enough for tonemapping).

CounterPillow commented 3 years ago

GPU integrated into a CPU. So if the gpu is overloaded, htop would show this. Init?

no, that's what intel_gpu_top is for. Hilarious logic, though.

armodim commented 3 years ago

GPU integrated into a CPU. So if the gpu is overloaded, htop would show this. Init?

no, that's what intel_gpu_top is for. Hilarious logic, though.

Didn't know about the tool. Thanks! 4k 60fps HDR video (Costa Rica): https://0x0.st/-P4h.png (100% gpu utilization); 4k 60fps NO HDR video ( Godzilla vs Kong ) : https://0x0.st/-PJX.png ( 50% gpu utilization).

bedrin commented 2 years ago

Try hdr-compute-peak=no

zefr0x commented 1 year ago

I had the same problem, my GPU was not loaded as is my CPU. I was able to fix it switching to the Vulkan API.

--gpu-api=vulkan

Note : Vulkan might cause some problems for some people depending on your drivers and your hardware.