8

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 :-(

Fabby
  • 34,259
guettli
  • 1,777
  • @guettli What is your graphics card? Please add output of vainfo (installable with sudo apt install vainfo) to the question. – N0rbert Nov 19 '18 at 08:37
  • @N0rbert I updated the question – guettli Nov 27 '18 at 20:08
  • Using mpv, with my not so powerful onboard Intel 3rd Gen Core processor Graphics Controller, it dropped about 50 frames. Ffmpeg says the video is a 4K with video stream bitrate 97501 kb/s. It's the heaviest video this laptop has ever seen :D – aasril Nov 29 '18 at 09:05
  • sandybridge is pretty weak, post this, inxi -CG For curiosity does this work any better, https://0x0.st/sGsn.mp4 (still 4k, reduced bit rate) note that totem probably doesn't use vaapi by default (needs gstreamer1.0-vaapi package which can be an issue), , vlc probably does, try mpv. – doug Nov 29 '18 at 23:45
  • P.S. Thanks for the acceptance, favour returned: question upvoted! ;-) – Fabby Dec 03 '18 at 00:32

4 Answers4

3

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 :)

N0rbert
  • 99,918
3

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...

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...

Fabby
  • 34,259
  • You'd probably want to rotate the vid also, 90 degrees clockwise, i.e add -vf "transpose=1" to ffmpeg command – doug Nov 29 '18 at 23:33
  • @doug Probably OP has a portrait screen or he would have filmed it in landscape mode, no? ;-) >:-) – Fabby Nov 29 '18 at 23:34
  • It's a Sandy Bridge Processor so over a decade old? The Intel Integrated graphics aren't that great. Definitely no mention of nVidia or Radeon card in OP's question but it's in your answer my friend :) – WinEunuuchs2Unix Nov 29 '18 at 23:38
  • We'll see! ;-) @WinEunuuchs2Unix I'm very good at reading between the lines and gyrating towards the correct Root Cause... – Fabby Nov 29 '18 at 23:39
  • Maybe, or maybe he holds phone upright. Not mentioned in post, only that it's sandybridge mobile which presumes a laptop. – doug Nov 29 '18 at 23:51
  • Yeah, that's a mistake a lot of people make, that's why I mentioned the portrait screen and the ;-) >:-) @doug – Fabby Nov 30 '18 at 00:01
  • 1
    Reducing the size with ffmpg was a good idea. The video size decreased a lot and the videos are not choppy any more. Thank you! – guettli Dec 02 '18 at 20:23
  • I get this warning: deprecated pixel format used, make sure you did set range correctly. Is there a way to avoid this message? – guettli Dec 02 '18 at 20:24
  • The size is given like this -s 1110x832 in your command. Does this work for both (landscape and portrait) orientations? – guettli Dec 02 '18 at 20:30
  • Deprecated pixel format is just a warning that this video format is not 16:9 or 4:3 or any of the other "standard" formats. It can be safely ignored. ;-) The ffmpeg command was calculated especially for your use case to keep everything as is, just a lower resolution and frame rate. If that would not be sufficient, leave a comment (now both X and Y axes are divided by 3 and rounded up) ;-) @guettli P.S. Bitte! ;-) – Fabby Dec 02 '18 at 22:27
  • I have an Intel® Core™ i7-7700HQ CPU @ 2.80GHz × 8 , GeForce GTX 1050/PCIe/SSE2 propietary drivers installed, chopy video still in vlc – Nicolas Molano Mar 29 '20 at 13:27
  • @NicolasMolano I have the same order of magnitude specs and on my machine and that video plays wonderfully, so if you followed the above steps and it would not resolve your question, just Ask another question – Fabby Mar 29 '20 at 14:42
1

18.04 with Gnome Desktop on an old Sandy Bridge processor's Integrated Graphics would be very slow simply moving around windows and resizing them. Try the Unity Desktop instead:

For even greater speed and possibly stability try Ubuntu 16.04 with Unity Desktop:

1

Xubuntu 18.10 amd 64; 2GB RAM; 3rd generation Intel i3 3120m

On Firefox:- Doesn't simply play. Browser doesn't hang either, it's just shows the video thumbnail. Maybe because of low server speed or maybe Firefox can't handle, not sure.

On MPV with SMPlayer frontend:- Plays smoothly, probably without frame-drop (as it isn't allowed in SMPlayer settings). Though it looks a bit strange on my 720p display. Especially the railings of the gate.

I'm a newcomer in Ubuntu but I've installed these stuff after installing it-

ubuntu-restricted-extras ffmpeg libavfilter-extra i965-va-driver-shaders va-driver-all beignet-opencl-icd

However you probably can't install the beignet-opencl-icd as Open CL isn't officially supported on 2nd generation (Sandybridge) processors.

Hardware decoding is enabled in SMPlayer (video output driver and hardware decoder is set to vaapi, no. of threads for decoding is set to 4)

  • Oh, you're using vanilla Ubuntu? I can't even run Ubuntu smoothly (17.10 & above) without doing anything, while Kubuntu runs fine on my 7 year old notebook (even Windows 10 runs better than Ubuntu). Maybe you should try any other flavour of Ubuntu, I use Xubuntu. While it's lightweight & very CPU friendly, it doesn't look that nice. Though it depends on the taste. – HattinGokbori87 Dec 03 '18 at 08:06