1 (edited by Blackfyre 30-12-2017 22:47:59)

Topic: Re-visiting MPV with 4K

Hi @Chainik and others,

Merry Christmas and a happy new year to all of you.

Now that MPV has added Vulkun support. There was reports earlier that MPV Player might finally be able to play 4K content without too much CPU usage after new API support. The reason we need this, is because right now we have no method of playing 4K 10Bit HDR content smoothly at all. Except using the build in TV Motion Smoothness options. MPC is restricted because of ffdShow with doesn't support 10Bit HDR, so hopefully we can get SVP & MPV to work with one of the new supported API's.

I am willing to do some testing. How do I change MPV Player to use the other API's and what are the codes needed please?

The way I know right now is to create a mpv.conf file in C:\Users\YourUsernameHere\AppData\Roaming\mpv directory. Then adding lines such as --gpu-api=vulkan to use vulkan api for example. Is that correct and are there other options available here to add into the configuration file that we can use to improve performance?

I am really hoping we can get 4K content to work properly with MPV.

Any information regarding how to configure MPV player and play around with its settings will be helpful.

MY HARDWARE:

4790K @ 4.7Ghz
GTX 1070 @ 2088Mhz Core & 9040Mhz Memory
16Gb RAM @ 2400Mhz @ C11

Re: Re-visiting MPV with 4K

# use ANGLE if you have problems with default d3d11 renderer
#gpu-context=angle
# OR the newest VULKAN API
gpu-api=vulkan
spirv-compiler=nvidia

3 (edited by cczzhh 30-12-2017 17:49:26)

Re: Re-visiting MPV with 4K

Now that SVP has added Vulkun support.

??? I think you wanted to say that mpv has added vulkan support?

--gpu-api=vulkan is for command line use. You need to write gpu-api=vulkan (removing the leading dashes) in mpv.conf.

Try native 60fps 4K 10bit hdr first: http://4kmedia.org/samsung-travel-with- … d-4k-demo/
If it works, then go for svp.

Re: Re-visiting MPV with 4K

dlr5668 wrote:
# use ANGLE if you have problems with default d3d11 renderer
#gpu-context=angle
# OR the newest VULKAN API
gpu-api=vulkan
spirv-compiler=nvidia

Looks like both Vulkan API and using the gpu-context=angle still cannot run 4K HDR content properly. Still choppy sadly.

cczzhh wrote:

Now that SVP has added Vulkun support.

??? I think you wanted to say that mpv has added vulkan support?

Fixed it, thanks. Yeah that was a mistake.

Re: Re-visiting MPV with 4K

it's not a renderer issue because mpv shows abnormally high CPU usage on 4K even with null renderer

Re: Re-visiting MPV with 4K

Chainik wrote:

it's not a renderer issue because mpv shows abnormally high CPU usage on 4K even with null renderer

Yes that's true. They should really address this issue. By the way does this occur even with Threadripper and other 12 or 16 core CPU's?

So we still don't have a way to watch 4K 10Bit HDR content with SVP?

Re: Re-visiting MPV with 4K

well, Ryzen 7 can play 4K with mpv smoothly
not with highest settings as with MPC-HC though...

Re: Re-visiting MPV with 4K

Yeah we need good 4k HDR SVP support for mpv or mpc smile

Re: Re-visiting MPV with 4K

where did u find so much hdr 2k+ content ?

Re: Re-visiting MPV with 4K

there were 20+ UHD BDs on trackers month ago big_smile

11 (edited by dejavecue 03-01-2018 09:35:54)

Re: Re-visiting MPV with 4K

cczzhh wrote:

Now that SVP has added Vulkun support.

??? I think you wanted to say that mpv has added vulkan support?

--gpu-api=vulkan is for command line use. You need to write gpu-api=vulkan (removing the leading dashes) in mpv.conf.

Try native 60fps 4K 10bit hdr first: http://4kmedia.org/samsung-travel-with- … d-4k-demo/
If it works, then go for svp.

If you want to use Vulkan, I would suggest the following additions to the mpv.conf:

profile=gpu-hq
gpu-api=vulkan
gpu-context=winvk
hwdec=no

vd-lavc-dr=yes
vd-lavc-threads=16 | Adapt this to the number of threads your CPU can handle simultaneously

dlr5668 wrote:

where did u find so much hdr 2k+ content ?

4K blurays have recently been cracked (AACS2.0 I believe)

Re: Re-visiting MPV with 4K

Latest mpv commits with re-written video filters code seems to improve performance and stability a lot.
Still need to test this version cause there're so many changes hmm

Here's the latest .exe for test.

Post's attachments

mpv-4k.png, 45.26 kb, 602 x 718
mpv-4k.png 45.26 kb, 351 downloads since 2018-02-05 

13 (edited by dejavecue 05-02-2018 13:17:02)

Re: Re-visiting MPV with 4K

Chainik wrote:

Latest mpv commits with re-written video filters code seems to improve performance and stability a lot.
Still need to test this version cause there're so many changes hmm

Here's the latest .exe for test.

Thanks Chainik. I'll test this .exe and report back

Edit: Well, that was fast - after 30 secs of playing a 1080p file, it crashed the display driver. Should I post my config as well as my SVP settings?

Re: Re-visiting MPV with 4K

Tested new mpv version with 4K movie content (Blade Runner) with my i7-2600 and GTX 1070 with 48fps and lowest quality settings in SVP and got SVP Index between 0,8 and 0,9. Before new mpv version i had SVP Index between 0,7 and 0,8. It was improved but still not playable for me hmm i know my cpu isnt good enough. At least I can play 4K content (Also only with 48fps and lowest quality settings in SVP) with mpc-hc but not with HDR (ffdshow doesnt support HDR yet).

Still, for me the mpc-qt has better (best) performance with 4K content than the mpv default player. If you enable hadware-accelerated decoding and CrystalHD/CUDA hardware decoding backend in mpc-qt you get some more performance stability. In some sences of the same 4K movie (Also Blade Runner for this test) I get smooth 48fps, but in other scenes it stutter again. But care, you need a high end gpu for that settings in mpc-qt.

Well, I think the only chance to play 4K content is to buy newer CPU, or wait for further versions with improved performance.

Re: Re-visiting MPV with 4K

HardesFaktor wrote:

Tested new mpv version with 4K movie content (Blade Runner) with my i7-2600 and GTX 1070 with 48fps and lowest quality settings in SVP and got SVP Index between 0,8 and 0,9. Before new mpv version i had SVP Index between 0,7 and 0,8. It was improved but still not playable for me hmm i know my cpu isnt good enough. At least I can play 4K content (Also only with 48fps and lowest quality settings in SVP) with mpc-hc but not with HDR (ffdshow doesnt support HDR yet).

Still, for me the mpc-qt has better (best) performance with 4K content than the mpv default player. If you enable hadware-accelerated decoding and CrystalHD/CUDA hardware decoding backend in mpc-qt you get some more performance stability. In some sences of the same 4K movie (Also Blade Runner for this test) I get smooth 48fps, but in other scenes it stutter again. But care, you need a high end gpu for that settings in mpc-qt.

Well, I think the only chance to play 4K content is to buy newer CPU, or wait for further versions with improved performance.

Hello.
Are you doing anything special to play the UHD (4k) content with SVP and MPC-HC? Last time I tried it was really slow but likely my HTPC is not up  to part in specs even with the overclocking. Maybe my main PC could handle it but is nowhere near that projector room. smile

16 (edited by kathampy 30-05-2018 09:09:30)

Re: Re-visiting MPV with 4K

I'm unable to play 4K content either. I have an i7 4820K at 4.5 GHz, GTX 1080, LAV Filters HW decoding with DXVA Copyback, madVR, MPC-BE. If I reduce the quality slider to minimum, SVP Index stays above 1.0 but it still plays in slow motion and lags behind the audio. CPU usage is barely 50% across all cores. This only seems to be an issue with 10-bit high bit-rate content and not with 4K YouTube videos etc.

Re: Re-visiting MPV with 4K

Using mpv, I have very good 4k playback of a (legally purchased) UHD ripped to MKV with the following config/environment.

Ubuntu 16.04 64-bit
AMD Phenom(tm) II X4 840 Processor × 4
GeForce GTX 1050 Ti/PCIe/SSE2 (4GB DDR5 RAM)

NVIDIA DRIVER VERSION: 410.48
(experimental driver supporting CUDA, from NVIDIA website following their installation instructions, using their packages to add all necessary CUDA support)

https://developer.nvidia.com/cuda-downl … e=deblocal

THEN THIS FOR MPV with CUDA baked in

https://howto-ubuntunew.blogspot.com/20 … er-in.html

mpv compiled from source with CUDA support:

mpv git-2018-10-02-2b0b9bb Copyright © 2000-2018 mpv/MPlayer/mplayer2 projects
built on Mon Oct  8 04:31:35 UTC 2018
ffmpeg library versions:
   libavutil       56.19.101
   libavcodec      58.32.100
   libavformat     58.18.104
   libswscale      5.2.100
   libavfilter     7.33.100
   libswresample   3.2.100
ffmpeg version: git-2018-10-07-3d30874

Success came after switching from cuda to nvdec
/home/<yourhome>/.config/mpv/mpv.conf contains:

hwdec=nvdec
vo=gpu
profile=gpu-hq

=====================
NOTE: There is an 18.04 install for the NVIDIA CUDA support and experimental driver. get it from the site.  Other instructions on the web weren't bad, but didn't quite get me there.
Also, previously had a GTX 1030 which had 4K but no CUDA support, didn't work with either CUDA Or VDPAU. Then upgraded to a GeoForce 1050 2GB, which *might* possibly have worked if I had thought to try the nvdec decoder which uses FFMPEG. If you have one, it's worth a try, though I noticed it was maxing out the video card RAM when using cuda.  I decided to keep the EVGA Single Fan GTX 1050 TI because it was only $42 more and I like having the 4GB of RAM. 
Before I switched to nvdec, the video would play using hardware encoding but had large sections where it stuttered and just rendered sound with a green screen. Always the same spots.

The MPV link below was helpful in figuring out my config:

https://mpv.io/manual/stable/#video

If you run mpv from the command line you can see whether it's using hardware encoding (also, my CPU stayed well under 30% as opposed to hitting 100% on all 4 cores)
If you don't run from command line, on Linux, you can check with nvidia-smi or with the Nvidia control panel  to see that the Video Processing engine and GPU are getting a nice little work out. Nothing too serious though for the 1050TI, memory and GPU were well under 50% during playback the whole movie.

The following link is useful for figuring out how to see if mpv is using hardware encoding:
https://negativo17.org/plex-media-playe … with-cuda/

Happy dancing because my 7 year old AMD CPU gets to live on and I save some coin while I sit back and watch how the RYZEN v I9 comparisons play out for my next build.

Good luck on your 4K quest!

18 (edited by dlr5668 21-10-2018 09:02:30)

Re: Re-visiting MPV with 4K

i9 gives +10% fps with cards like 1080ti and up to 17% with 2080ti and good overclock (1080p resolution, lower in 1440p). Not worth it

19 (edited by Blackfyre 23-10-2018 15:15:10)

Re: Re-visiting MPV with 4K

4kquest wrote:

Success came after switching from cuda to nvdec
/home/<yourhome>/.config/mpv/mpv.conf contains:

hwdec=nvdec
vo=gpu
profile=gpu-hq

DUDE! You are a legend!

This is the first time I can run 4K Content with no dropped frames using SVP + MPV with my 4790K @ 4.7Ghz

Could never even come close before! Unbelievable, GPU usage increases with this, CPU usage decreases and I can finally run 4K @ 60FPS smoothly using MPV Player.

EDIT: The only issue that remains now is 4K HDR content still drops frames with my custom settings. But it's actually promising because using the automatic profile on High Performance actually works with 4K HDR on a 4790K & GTX 1070 when using MPV.

20 (edited by stereoman 01-11-2018 06:32:24)

Re: Re-visiting MPV with 4K

Blackfyre wrote:
4kquest wrote:

Success came after switching from cuda to nvdec
/home/<yourhome>/.config/mpv/mpv.conf contains:

hwdec=nvdec
vo=gpu
profile=gpu-hq

DUDE! You are a legend!

This is the first time I can run 4K Content with no dropped frames using SVP + MPV with my 4790K @ 4.7Ghz

Could never even come close before! Unbelievable, GPU usage increases with this, CPU usage decreases and I can finally run 4K @ 60FPS smoothly using MPV Player.

EDIT: The only issue that remains now is 4K HDR content still drops frames with my custom settings. But it's actually promising because using the automatic profile on High Performance actually works with 4K HDR on a 4790K & GTX 1070 when using MPV.


Any chance you can share your settings? I've literally got the same CPU and Graphics card as you, I am using Windows 10 64 and I've been trying to get SVP working with MPV ever since reading your post, desperately want to get HDR content running at 60fps, tonight I was at the point of re encoding my entire UHD Video library into 60 fps but decided against it, it's a bit overkill and I'd rather get SVP to work. Anyway if you can help I'd appreciate it.

Here's the settings I'm using, I've set SVP to automatic mode and it is working in a window but as soon as I go fullscreen I lose HDR, windows reverts to standard 4k mode not sure why that's happening but in a window HDR is workjing with SVP and seems fairly smooth , this is with the mpv64 version installed through the SVP installer, I've also installed the Nvidia Cuda Toolkit as explained in the previous post.

input-ipc-server=mpvpipe

gpu-api=opengl
hwdec=nvdec
vo=gpu
profile=gpu-hq

priority=high

scale=ewa_lanczossharp
cscale=ewa_lanczossharp
dscale=ewa_lanczossharp
dither-depth=auto
correct-downscaling=yes
sigmoid-upscaling=yes
deband=yes

vd-lavc-dr=yes
vd-lavc-threads=16

Re: Re-visiting MPV with 4K

There's a serious performance bottleneck playing 4K (especially in 10 bit) with SVP in mpv.
We'll share our build with fixes soon, but I hope it will be fixed in upstream hmm
https://github.com/mpv-player/mpv/pull/6262

22 (edited by Blackfyre 02-11-2018 00:56:58)

Re: Re-visiting MPV with 4K

Chainik wrote:

There's a serious performance bottleneck playing 4K (especially in 10 bit) with SVP in mpv.
We'll share our build with fixes soon, but I hope it will be fixed in upstream hmm
https://github.com/mpv-player/mpv/pull/6262

YES! @Chainik

Looking forward to the update.

stereoman wrote:

Any chance you can share your settings? I've literally got the same CPU and Graphics card as you, I am using Windows 10 64 and I've been trying to get SVP working with MPV ever since reading your post, desperately want to get HDR content running at 60fps, tonight I was at the point of re encoding my entire UHD Video library into 60 fps but decided against it, it's a bit overkill and I'd rather get SVP to work. Anyway if you can help I'd appreciate it.

Here's the settings I'm using, I've set SVP to automatic mode and it is working in a window but as soon as I go fullscreen I lose HDR, windows reverts to standard 4k mode not sure why that's happening but in a window HDR is workjing with SVP and seems fairly smooth , this is with the mpv64 version installed through the SVP installer, I've also installed the Nvidia Cuda Toolkit as explained in the previous post.


4K works fine for you as well now yes? I have had no issues with normal 4K SDR content anymore. But HDR 4K is almost impossible right now with our processor, some HDR content runs with minimal Automatic settings; (Slider on Higher Performance all the way to the left & Artifact Masking on Low). But I don't enjoy that, so I download most my content in SDR now.

As for Windows 10, like the full-screen issue you mentioned, is really annoying with HDR too. Basically for HDR content I just watch on Netflix using Edge browser without SVP (since our GPU supports 4K HDR, because our CPU doesn't do the encoding), you need to go to the Windows Store and buy HEVC Video Extensions for 4K and 4K HDR to work with our GPU. It costs around $1 or $2 I think, and you have to use Edge Browser with Netflix. When you play the 4K content, use CTRL + ALT + SHIFT + S to change the bitrate quality, with 4K you should see 16000 bitrate.

This is my current mpv configuration:

gpu-api=vulkan
gpu-context=winvk
hwdec=nvdec
vo=gpu
profile=gpu-hq

priority=high

interpolation

scale=ewa_lanczossharp
cscale=ewa_lanczossharp
dscale=ewa_lanczossharp
dither-depth=auto
correct-downscaling=yes
sigmoid-upscaling=yes
deband=yes

vd-lavc-dr=yes
vd-lavc-threads=16

sub-font-size=40

23 (edited by stereoman 02-11-2018 02:56:49)

Re: Re-visiting MPV with 4K

I guess I'll just stick with my TV's built in interpolation and wait for the fixes. I also watch a lot of HDR stuff on Netflix, recently rewatched Daredevil, it looked very good for streaming but I still prefer Ultra HD Blu-ray, I watched The Revenant recently, whole film was shot in 8k, Absolutely stunning in HDR! anyway cheers for the settings.

24 (edited by kathampy 07-08-2019 17:40:16)

Re: Re-visiting MPV with 4K

Chainik wrote:

There's a serious performance bottleneck playing 4K (especially in 10 bit) with SVP in mpv.
We'll share our build with fixes soon, but I hope it will be fixed in upstream hmm
https://github.com/mpv-player/mpv/pull/6262

Is this still an issue? 4K 10-bit video stutters with MPV + SVP, but plays smoothly with just MPV and even MPC + SVP.

Re: Re-visiting MPV with 4K

> Is this still an issue?

at least much less than before