How to configure VLC to play 4K content properly

11

3

Currently my main media player on Windows (10 Pro x64) is VLC but I noticed that when I want to play UHD content (2K, 4K videos) its freezes.

My PC's configuration: Intel i7 3770, 16GB RAM, 512GB SSD, nVidia GTX 970 4GB.

The sound is OK but the picture is freezing (2-3 frames per minutes).

I've tried to set the codecs or enabled/disabled the GPU acceleration without success.

What should I set to play this kind of content flowless?

P.S.: Media Player Classic plays the same file so smooth but I want to keep VLC as main player.

Bálint Babics

Posted 2016-11-08T13:57:08.073

Reputation: 181

Does the Audio keep playing without a hitch, only the video freezes ? – dExIT – 2016-11-11T08:40:31.737

@dExIT Correct. – Bálint Babics – 2016-11-11T08:46:08.617

Have you tried to amend caching times and FFmpeg Loop Filter Skipping, and have you changed your video output settings, lets say to DirectX DirectDraw or OpenGL ? – dExIT – 2016-11-11T08:52:38.417

Yes I did all of them, without success. With OpenGL the screen was completely magenta. I have the latest nV driver. – Bálint Babics – 2016-11-11T08:54:06.013

Please remember that normally VLC could be by default setup Video is decoded through CPU - aka integrated graphics. Please see and try to setup GPU decoding. https://wiki.videolan.org/VLC_GPU_Decoding/ setup GPU and then output settings need to be Direct X

– dExIT – 2016-11-11T08:55:07.720

And just to be on the 100% side, try to open a GPU monitor, and play the video and see if the usage of the GPU spikes. just to be sure :) – dExIT – 2016-11-11T08:56:05.390

If the Integrated Graphics is doing it, Sandy Bridge (i3/i5/i7 3*) can't really do 4K if I remember correctly. The GPU needs to be doing the decoding.

Also, is it 60fps or 30? Makes a big difference. – harley_woop – 2016-11-11T08:56:29.743

And remember Newest nVidia drivers are not always the best way to go. Even if they are stable. – dExIT – 2016-11-11T08:56:41.443

@harley_woop: the IGP is unrelevant here, becuase the CPU or the dGPU do the job not the IGP. And yeah, I know the GPU should do the decoding but when I set the option to use GPU to decode its not working. – Bálint Babics – 2016-11-11T09:46:01.587

@BálintBabics True, was confusing IGP and CPU. Still the GPU should be used if you can get it working. – harley_woop – 2016-11-11T10:15:53.950

I downloaded 4K videos from 4ksamples.com. VLC had no success playing videos encoded with the x265 codec, but other codecs worked fine. Which codec is used in your file? If unsure - use MediaInfo. It would also be useful to have a sample of the problematic 4K files. I had no trouble playing all 4K videos (including x265) when using Media Player Classic (MPC) that I got by installing K-Lite Codec Pack Mega.

– harrymc – 2016-11-11T13:19:09.580

I more or less have the same hardware. What format/codec? – Journeyman Geek – 2016-11-13T08:16:17.193

I've been experimenting a bit - trying dxva crashes, the test video I'm using is rotated and ... it feels like VLC is trying to decode this in CPU on one thread. – Journeyman Geek – 2016-11-14T00:17:09.387

Answers

9

I have succeeded in reproducing the problem using VLC version 2.2.4.

The problem of freezing exists only if "Hardware-accelerated decoding" is set to something else than "Disable".

Apparently VLC now supports GPU decoding, but I believe it is done in a very inefficient manner.
The article How to enable gpu accelerated decoding in VLC says this :

the data is decoded in the GPU at the decoding stage and then transferred back to the player so that the other stages, filtering and streaming for instance, can be processed.

I have managed better frame-rate when setting "Hardware-accelerated decoding" to "Disable". This puts the entire burden on the CPU and so requires a strong CPU.

User Journeyman Geek recommends increasing the thread number under Tools / Preferences / Video Codecs" / FFMPEG / Threads, but it worked for me with the default value of 0 which means "Auto". You might experiment further with other values for Threads. I just remark that the FFMPEG library is not used for all video formats.

VLC apparently does not support at the moment (2016) the x265 codec, since x265 videos did not play when downloaded from 4ksamples.com. However, everything worked flawlessly with Media Player Classic.

Edit (2018) : VLC now works successfully with these files.

harrymc

Posted 2016-11-08T13:57:08.073

Reputation: 306 093

For some reason my 4k video work flawlessly when I turned off the hardware acceleration. Thanks – Chan – 2018-09-18T01:51:36.190

1

I've been experimenting a bit with the puppies bath in 4k video off 4ksamples.com as well as a few others. I got a combination that worked with my test video. I note reasonably fast storage is essential for quality playback. Considering some trial and error is needed, do backup the current settings. These settings work on a 3770, 16gb of ram and a gforce 980TI which I know is 4k capable

I've changed quite a few advanced settings to get it to work. In theory I want DXVA to be enabled but that causes VLC to crash.

Under simple mode in preferences go to Tools -> Preferences and Input / Codecs and in the drop-down box for Skip H.264 in-loop deblocking filter change it to All. This is recommended by VLC

Switch to show all under preferences and try these changes

I turned off all filters under Video Filters. This was the last thing I did, and seemed to help the most so I'd start here

Under "Video Codecs" - > FFMPEG I set my threads to 3. You might want to experiment with higher or lower numbers.

Make sure everything under output modules/DirectX is unticked.

These changes seem to have worked.

For reference, once I stripped out the commented lines, my vlcrc looks like

[directdraw] 
directx-hw-yuv=0
directx-3buffering=0
[direct3d] 
direct3d-shader=Disabled
[swscale] 
swscale-mode=9
[qt4] 
qt-privacy-ask=0
[x264] 
sout-x264-profile=main
sout-x264-preset=veryfast
sout-x264-tune=film
[qsv] 
sout-qsv-software=1
sout-qsv-h264-profile=decide
sout-qsv-h264-level=decide
sout-qsv-mpeg2-profile=decide
sout-qsv-mpeg2-level=decide
[avcodec] 
avcodec-skiploopfilter=4
avcodec-hw=any
avcodec-threads=3
[waveout] 
waveout-volume=0.700000
[directsound] 
directx-volume=0.700000
[filesystem] 
filetypes=m3u,db,nfo,ini,jpg,jpeg,ljpg,gif,png,pgm,pgmyuv,pbm,pam,tga,bmp,pnm,xpm,xcf,pcx,tif,tiff,lbm,sfv,txt,sub,idx,srt,cue,ssa
[core] 
aout=any
video-deco=0
vout=direct3d
video-filter=swscale
vod-server=any

I have a gist with my full vlcrc for 4k here

Journeyman Geek

Posted 2016-11-08T13:57:08.073

Reputation: 119 122

1Unfortunatelly it not solved my problem. I've tried to play 4k videos from 4ksamples but not working. Tried with only you've wrote and tried with the full gits vlcrc too. And I believe it not uses the GPU. – Bálint Babics – 2016-11-15T00:44:45.430

Yeah, its CPU only. Its odd though, I have the very same cpu and these settings work both on those and with other files – Journeyman Geek – 2016-11-15T00:49:28.207

I have noticed that the Skip Frame setting under Input/Codecs->Video codecs-> ffmpeg has made a big difference for me. Skip ALL just results in no frames making it to the output, which means only sound would play without picture. BiDir and Non-ref gave me the greatest playback speed improvements. – Tony Sepia – 2019-03-01T16:35:27.210