vlc 4k choppy while mplayer is smooth
Solution 1
Chances are you can offload the video playback onto the video card, instead of using the CPU(s).
Make sure you have the vaapi packages installed (for Intel/AMD video card):
sudo apt-get install libva1 libva-x11-1 vainfo vdpau-va-driver
If you have an Nvidia card add this:
sudo apt-get install vdpauinfo libvdpau
Since mplayer is working fine, it may already be using hardware acceleration. So these packages may already be installed.
Next, see if VLC will start with hardware acceleration:
vlc -v /path/to/name-of-file
There also is an option in the GUI to turn on hardware acceleration. Check to see what it is set on (Tools>Preferences>Input/Codec):
Solution 2
Is there a fix?
Answer to the question: it depends.
I think there are some other questions you have to ask in order to solve your problem of not being able to play 4K video without it being "choppy" using vlc:
- What videocard (GPU) do you have?
- Do you have the correct driver installed?
- are these drivers being used?
- Is mplayer using hardware acceleration?
- Is VLC using hardware acceleration?
- if yes: why is it not playing smoothly?
- what codec do you need?
- etc.
Hint
From your findings I guess mplayer is using hardware acceleration, since I don't know a CPU that can playback 4K video, so I guess that you probably have a GPU that is good enough to playback 4K.
Related videos on Youtube
![gregoiregentil](https://i.stack.imgur.com/kvnHz.jpg?s=256&g=1)
gregoiregentil
Updated on September 18, 2022Comments
-
gregoiregentil almost 2 years
I'm trying to run a 4k h264 MPEG4-AVC part 10, 4k 3840x2160 video. It's totally choppy on VLC (2.1.6 Rincewind) which seems to use only one CPU. The video is perfectly smooth on mplayer which seems to use more than one CPU. My laptop is not super recent but it's still a powerful 2.5GHz i7 Samsung device. Is there a fix?
EDIT #1
DPKG info:
dpkg -l | grep libva ii libva-dev:amd64 1.3.0-2 amd64 Video Acceleration (VA) API for Linux -- development files ii libva-drm1:amd64 1.3.0-2 amd64 Video Acceleration (VA) API for Linux -- DRM runtime ii libva-egl1:amd64 1.3.0-2 amd64 Video Acceleration (VA) API for Linux -- EGL runtime ii libva-glx1:amd64 1.3.0-2 amd64 Video Acceleration (VA) API for Linux -- GLX runtime ii libva-tpi1:amd64 1.3.0-2 amd64 Video Acceleration (VA) API for Linux -- TPI runtime ii libva-wayland1:amd64 1.3.0-2 amd64 Video Acceleration (VA) API for Linux -- Wayland runtime ii libva-x11-1:amd64 1.3.0-2 amd64 Video Acceleration (VA) API for Linux -- X11 runtime ii libva1:amd64 1.3.0-2 amd64 Video Acceleration (VA) API for Linux -- runtime ii libvamp-hostsdk3:amd64 2.5+repack0-2 amd64 helper library for Vamp hosts written in C++
LSPCI info:
lspci | grep VGA 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
CPU info: cat /proc/cpuinfo | grep CPU model name : Intel(R) Core(TM) i7-3537U CPU @ 2.00GHz model name : Intel(R) Core(TM) i7-3537U CPU @ 2.00GHz model name : Intel(R) Core(TM) i7-3537U CPU @ 2.00GHz model name : Intel(R) Core(TM) i7-3537U CPU @ 2.00GHz
mplayer seems to use 3 CPU as I'm at 75% in CPU monitor. Here is the log: http://pastebin.com/65Uuk3An
I tried the acceleration in vlc (automatic mode for acceleration) but it's still choppy: http://pastebin.com/F8TZXxnG
EDIT #2
vainfo was returning an error. I have just installed i965-va-driver, vdpau-va-driver, libvdpau-va-gl1 on my Ubuntu 14.04. vainfo now returns: http://pastebin.com/r0DcMMUg
Mplayer nows takes 100% CPU (all cores).
VLC is still choppy though it now finds va_openDriver and doesn't report an error like in my edit #1. Also, note that VLC never returns and I have to kill -9 it. It has always been the case when decoding a 4k file.
Edit #3
Here is a more verbose debug of vlc: http://pastebin.com/8ykvG9rc. As you can read:
avcodec decoder warning: threaded frame decoding is not compatible with avcodec-hw, disabled
Also:
avcodec decoder debug: using slice thread mode with 4 threads
I only see 25% CPU usage while mplayer does 100%. In any case, hardware doesn't seem to be used (even with mplayer).
-
Admin over 8 yearsJust so we have a little more to work with: what is the output of "cat /proc/cpuinfo | grep CPU" and "lspci | grep VGA"?
-
-
gregoiregentil over 8 yearsThanks! I have edited the question to go one step beyond.
-
G Trawo over 8 yearsWhat was the output when you ran the vlc command from the command line? Also, what does 'vainfo' output?
-
G Trawo over 8 yearsI moved ' vdpau-va-driver' to the intel part of the packages. Try installing that package and change the hardware-accelerated decoding to 'VA-API video decoder via X11'.
-
gregoiregentil over 8 yearsI have edited the question a second time with more info.
-
G Trawo over 8 yearsThere is a newer version of VLC you may require to play back 4k, but 14.04 only goes to 2.1. For you to get 2.2 you will have to install this PPA: 'ppa:mc3man/trusty-media' . Be mindful that that PPA will cause issues when you upgrade your LTS version. Always do a purge first.
-
gregoiregentil over 8 yearsThis ppa is going to break everything I have. trac.videolan.org/vlc/ticket/16095
-
G Trawo over 8 years@gregoiregentil Since you won't get VLC through a PPA, why not give compiling it from source a go: wiki.videolan.org/UnixCompile
-
Chris1804505 over 7 yearsI got version 2.2.4, I still got a laggy/sloopy video. Despite the settings of the threads and decoding on VDPAU (I have also nvidia driver, with proprietary driver). VLC is just not working! Too bad since I use VLC for all movies, but 4K is just not working. Mplayer is.
-
gregoiregentil almost 7 yearsWhich Ubuntu version do you have?