mpv-player / mpv

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

Can the rendering performance being improved by intel Quick Sync Video or OpenCL? #3991

Closed JulianLai closed 7 years ago

JulianLai commented 7 years ago

mpv version and platform

mpv 0.22.0 (C) 2000-2016 mpv/MPlayer/mplayer2 projects
 built on Thu Dec 15 21:04:53 UTC 2016
ffmpeg library versions:
   libavutil       55.43.100
   libavcodec      57.68.100
   libavformat     57.60.100
   libswscale      4.3.101
   libavfilter     6.68.100
   libswresample   2.4.100
ffmpeg version: 3.2.git

intel HD 4600 is poor at rendering, it always looks laggy with deband, and it can't play 1080p video with opengl-hq either, is there any way to improve the rendering performance by using QSV or OpenCL?

Cpuroast commented 7 years ago

While I doubt QSV or OpenCL are an option. QSV would only help for decoding which is currently handled by your cpu, unless you supplied hwdec as an option.

I do know that HD4000 and up is strong enough to handle 1080p with opengl-hq, tested just now on my own HD4000. Also, I would assume the HD4600 is slightly faster than my older HD4000 GPU.

If you didn't know:

This is what the opengl-hq profile entails:

[opengl-hq] scale=spline36 cscale=spline36 dscale=mitchell dither-depth=auto correct-downscaling=yes sigmoid-upscaling=yes deband=yes

As you can see debanding is part of it.

Also mpv 0.23 is current, so it's always good to try the latest.

JulianLai commented 7 years ago

It is my settings:

vo=opengl
profile=opengl-hq
sub-auto=fuzzy
hwdec=auto
sub-font="AR PL UKai TW"
sub-border-size=1.5
stretch-image-subs-to-screen=yes
fs
af=lavfi=[sofalizer=sofa=/home/user/.config/mpv/ClubFritz4.sofa:gain=13:speakers=FL 22.5|FR 337.5|BL 150|BR 210:type=freq]
sub-use-margins=no
sub-bold=yes
sub-shadow-offset=1.0
sub-shadow-color=000000
audio-device=alsa/plughw:CARD=PCH,DEV=0
script-opts=autospeed-xrandr=true,autospeed-osd=true,autospeed-spause=2,autospeed-speed=true,autospeed-estfps=true

Although it can play a 1080p 23.976fps movie without displaying frame drops information on the OSD, I still can see that it isn't as smooth as playing without opengl-hq, and it will be a disaster if you try play a 1080p 60fps video with it, not even mention the 4K 60fps video..

Cpuroast commented 7 years ago

1080p60 I can understand, that's quite a bit more work for the scaler/renderer. I never tested it with 60fps, very little 60fps content around, it's all most 23.976 and maybe 29.976 sometimes.

Pretty sure your GPU can't even decode 4K in hardware using hwdec, so it falls back to software decoding using the CPU and when it does the CPU has to be strong enough to deal with it. 4K60 in software isn't a walk in the park, it requires a pretty strong CPU to handle it. Even if you commented out opengl-hq, it would most like still struggle with the GPU less involved.

But yeah HD4XXX series wasn't amazingly powerful, but quite a bit better than HD3XXX series. They started getting quite interesting with HD5XXX series, especially with Iris and Iris Pro.

JulianLai commented 7 years ago

HD4600 can't play 4K 29.970fps video smoothly with opengl-hq either, does the HD5XXX improve that much?

Cpuroast commented 7 years ago

I bet your system doesn't play 4K smoothly at all even without opengl-hq, also at that res, you don't really need much of the fancy scaling provided by opengl-hq.

JulianLai commented 7 years ago

It can play 3840*2160p 29.97fps video with no frame drops without opengl-hq.

Cpuroast commented 7 years ago

ok, that means the CPU is strong enough to handle the decoding of at least that, but the GPU is too weak to handle the rendering when opengl-hq is turned on.

Realistically you don't really need everything provided by opengl-hq for 4K rendering.

Feel free to disable opengl-hq, by putting a # in front, aka commenting it out.

Then go through the options opengl-hq provides and enable/disable as needed:

scale=spline36 - Only used when upscaling.

cscale=spline36 - Used to upscale chroma information, this will always help as chroma nearly always has to be upscaled.

dscale=mitchell - Only used when downscaling.

dither-depth=auto - Affects dithering from higher bit-depth color, to lower ones. correct-downscaling=yes - Only affects downscaling sigmoid-upscaling=yes - Only affects upscaling deband=yes - Debanding of course.

opengl-hq is simply an alias or a shortcut to the options mentionned above.

haasn commented 7 years ago

If you're having trouble playing high res content, and you're confirmed that the issue is a GPU bottleneck and not a CPU bottleneck, then the best thing to do is to turn off debanding, follower by lowering your cscale settings.

Everything else only depends on the output resolution rather than the content resolution.

kevinlekiller commented 7 years ago

You can use intel_gpu_top to check your GPU usage.

The HD4600 is weak, it's similar in performance to Nvidia's most budget card, the GT 710 (I own both and have tried mpv on both).

If you want better performance, get a discrete GPU like an AMD RX 460 or GTX 1050, those will be 2x faster than the best Intel GPU (Iris Pro 6200).

In my experience, if you want to use all mpv's most demanding options and have some headroom (at high res / high fps), you will want at least a RX 480 / GTX 1060.

haasn commented 7 years ago

If you want better performance, get a discrete GPU like an AMD RX 460 or GTX 1050, those will be 2x faster than the best Intel GPU (Iris Pro 6200).

Comparing the texture fill rate (one of the most important metric to judge mpv performance), I see:

As you can see, the three are not even remotely comparable, being separated by an order of magnitude each when it comes to the performance.

In my experience, if you want to use all mpv's most demanding options and have some headroom, you will want at least a RX 480 / GTX 1060.

Only at higher resolutions, I'd say. At something like 1080p a RX 480 is way overkill. But for 4K, probably, yes.

kevinlekiller commented 7 years ago

Only at higher resolutions, I'd say. At something like 1080p a RX 480 is way overkill. But for 4K, probably, yes.

Yeah, edited my post before you commented hehe, I mostly play 4K or 1080p 60fps stuff.

JulianLai commented 7 years ago

@kevinlekiller RX480 just for playing 4K video!! What!!! By the way, could I see your settings of MPV?

mia-0 commented 7 years ago

For playing high-resolution video with high-quality scaling (i.e. EWA). I have a HD4600 myself. It is enough for opengl-hq at 1080p24, but just barely. In general, HD4600 just has so little fill rate it is nearly useless for resolutions above the laptop-typical 1366x768. Forget about doing anything at 60 FPS with a 1920x1080 display.

So no, QSV will not fix your sad excuse for a GPU. It can only help with decoding, not displaying.

haasn commented 7 years ago

@JulianLai The guy is talking about full-on meme settings with jinc upscaling, debanding, HDR tone mapping and whatnot. AKA stuff 99% of people don't need

kevinlekiller commented 7 years ago

@JulianLai I mean at overkill settings, not just opengl-hq.

I have to head out but I'll post the mpv.conf file for that computer when I'm back.

edit: Uploaded it here: https://gist.github.com/kevinlekiller/53ef3f4fada7023fe06563afcb0ec390

JulianLai commented 7 years ago

@lachs0r Is the video-sync=display-resample resources hungry? HD4600 seems can't take it.

mia-0 commented 7 years ago

No it isn’t. If it causes lag/framedrops, that’s because your GPU can’t render fast enough either way.

kkkrackpot commented 7 years ago

@kevinlekiller Could you explain why you choose rgba32f for FBO format?

kevinlekiller commented 7 years ago

It's the highest possible value, and my machine doesn't mind the performance impact, regardless of if it improves quality or not.