Choppy video under Ubuntu but not Windows

This video is not playing smoothly with totem or VLC under Ubuntu:

http://thomas-guettler.de/tmp/20181011_113036-0.MP4

It works with Windows.

What I mean with "is not playing smoothly" is:

  • I see it, but it looks like there are only four frames. The playing jumps.
  • On Windows it is smooth. You see the car in the background drive along.

Version: Ubuntu 18.04.1 LTS

Is there a way to get it working like it should???

===> vainfo
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Sandybridge Mobile - 2.1.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

Background: This is just an example. All videos created by my Lumix camera don't play well under Ubuntu :-(


This is an H.264 30FPS high-resolution video and to play it smoothly you need hardware acceleration, and as it plays smoothly under Windows and not under Ubuntu, (I'm assuming this is on the same machine) this leads me to believe you have installed the correct video drivers under Windows but not under Ubuntu.

So this has nothing to do with Ubuntu or the video itself, but with the video drivers under Ubuntu...

  • Go here for nVidia
  • Go here for AMD

If it plays well on a fast new Windows machine and doesn't play well on an old clunker that has Ubuntu installed, just transcode the video to a lower resolution and frame rate and the old clunker will be able to play it smoothly as well:

ffmpeg -i 20181011_113036-0.MP4 -c:v libx264 -strict -2 -r 25 -s 1110x832 -c:a libmp3lame -b:a 256K 20181011_113036-1.MP4

Note: On my machine running Ubuntu, 20181011_113036-0.MP4 plays smoothly out of the box...


I can play the video in Firefox and VLC (both installed on Ubuntu 18.04 LTS inside VirtualBox).

So it seems that you have not installed some codecs. Install them with:

sudo apt install ubuntu-restricted-addons

and try again :)


Note: for integrated Intel hardware acceleration is provided by i965-va-driver package; for Nvidia it is provided by libvdpau_nvidia.so library (installed with proprietary driver). You can check status of your VA with vainfo command.


Remarks: on physically installed Ubuntu MATE 16.04.5 LTS the video is played flawlessly only on Haswell i7 (using Intel® HD Graphics 4600). Mobile Ivy Bridge with Intel® HD Graphics 4000 plays video with jumps (in vlc, mplayer, totem, kaffeine, mpv, parole).
If the video is really 4K, then it may be too hard for old graphics :)