Ubuntu – VLC Pixelated Video When Skipping

16.04vlc

After upgrading from Ubuntu 14.04 to 16.04 I immediately noticed an issue whereby VLC now shows terrible video when you skip around, which only appears to fix itself after a few seconds, which I am guessing when it next meets a keyframe. This can be shown in the screenshot below:

enter image description here

I have tried the following to resolve the issue:

  • Using VLC's stable ppa to get a later verison of VLC (VLC media player 2.2.4 Weatherwax)
  • Changing from nvidia driver 361.42 to 340.96 (which didn't work so I switched back, I made sure to reboot each time). I also tried the X.Org X server – Nouveau driver.
  • Trying various outputs from Automatic to X11 Video Output XCB, and OpenGL GLX video output (XCB).
  • Changing the Hardware-accelerated decoding from Automatic to Disable (under the Input/Codecs tab)
  • Disabling all but my primary monitor.

I notice that if I pause the video, skip to any location, wait a second or two, and then play, the video will be fine. I just need VLC to wait until it is ready instead of trying to plow on immediately with the audio and trying to get the video to sync up.

Other media players like mpv media player just work in this regard, but I noticed mpv media player doesn't allow me to skip to the next video for some reason which is why I'm going back to trying to fix VLC.

Update June 4th 2016

I just installed Xubuntu on my netbook and VLC works on there perfectly well. I tried both VLC 2.2.2 and 2.2.4 from the PPA. This issue looks like its Ubuntu Desktop specific or to do with the fact that my desktop monitor runs through an Nvidia GPU (but have tested using nouveau drivers).

Another thing I noticed is that streaming media from a remote host on the same network using an NFS share makes the problem far more noticeable.

Update 8th June 2016

I have uploaded a youtube video trying to demonstrate the change in behaviour where the audio never stops playing as you skip around, but the video will be "paused" and then kick in as pixelated before eventually sorting itself out. Normally both the audio and video would kick in together once the player is ready and there would be no video pixelation as shown here in this video of Xubuntu 16.04 using VLC.

Update 9th June 2016

It appears that videos I record using Kazam screen caster are not affected which led me to believe it was some proprietary codec or something. I revisited the decoding menu and found that only this option worked on a local file (I still had pixelation issues on the same video when it was loaded from an NFS folder but maybe that is yet another different issue?).

enter image description here

I am guessing that the DRM option is the important point here as VA-API via X11 did not work (and neither did "disable" or any of the others). I would now be keen to figure out what I need to do when I'm loading the vidoes from an NFS. Increasing the stream output muxer caching didn't fix it.

Final Update – It's an Nvidia Issue (9th June 2016)

This is definitely an Nvidia graphics card related issue (haven't tested AMD). After noticing that VA-API with DRM didn't work on my work computer (which is also running Ubuntu 16.04 with an Nvidia Graphics card), when I got home I tried installing xubuntu to test that theory. That didn't do the trick. After that I unplugged my Nvidia graphics card and am now using the integrated intel graphics (on i5-4670K) which is working brilliantly on "automatic" and even on files loaded from the NFS.

Normally I would post this as the answer, but I don't think many others would be happy with it. I hope that maybe someone will have a solution whereby I can plug in my graphics card again, but I think the reality is we need to wait for an update to the kernel and/or better proprietary drivers from Nvidia. What amazes me is that having the card in and using the opensource nouveau drivers, or switching off hardware acceleration doesn't work.

Best Answer

Update 19th October 2016

I noticed that my Nvidia module was recompiled during an update today, so I rebooted and tested this again. It looks like the issue has now been fixed. For reference, I am running the driver version 367.57 on an Nvidia GTX 970.


Original Answer

TL;DR

sudo apt-get purge nvidia-* -y
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update && sudo apt-get dist-upgrade -y

The critical point here is that installing the drivers PPA results in the libcuda1-361 libxnvctrl0 packages being upgraded which resolves the issue. I also found that I had issues with lots of the nvidia drivers so the safest thing to do is go back to the opensource driver. I have had some success with the nvidia-340 driver though.

Full Description

Ok somehow I managed to resolve the situation by accident

Firstly I installed the drivers ppa:

sudo add-apt-repository ppa:graphics-drivers/ppa

Then I purged the existing nvida drivers

sudo apt-get purge nvidia-*

enter image description here

Then I installed the 364 drivers.

sudo apt-get update
sudo apt-get install nvidia-364 -y

After rebooting, I was unable to log into Ubuntu desktop but could log into Xubuntu desktop from previous testing. This would work long enough for me to see that the video playback worked perfectly, but within a few minutes my computer would lock up and would require hard rebooting. After doing this a few times I purged the nvidia drivers again:

sudo apt-get purge nvidia-*

I no longer have the nvidia binary drivers installed and am on the Nouveau driver but the video playback is working and my computer doesn't lock up!