JanaW597
Posts: 3
Joined: Sun Jul 07, 2019 7:33 pm

Transition from omxpayer to vlc

Sun Jul 07, 2019 7:48 pm

Hi,

i still have a lot of mpeg 2 movies from my camcorder. Previously I could play them from the command line with omxplayer without issues.

As the hardware codecs are no longer supported on the new Pi4, I tried switching to vlc. But here i can´t get the movies to run smoothly. Tried the --fullscreen option, setting resolution, ... but having huge lags between frames. Resolution of the videos is 720p, if that matters.

Any suggestions what to try next? Any other player that can be started from the console?

Jana

User avatar
topguy
Posts: 5893
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Transition from omxpayer to vlc

Mon Jul 08, 2019 12:04 am

The Mplayer fork "mpv" is a pretty good player for console. You might have to play around with the "-vo" options to find the one that works best on a Pi4.

Moonmarch
Posts: 151
Joined: Thu Mar 07, 2019 1:34 am

Re: Transition from omxpayer to vlc

Mon Jul 08, 2019 1:40 am

On Raspbian Stretch VLC media player from the Debian repository is not hardware accelerated, don't know about Raspbian Buster for RPI4, I assume hardware acceleration is always activated compared to the RPI3 which is activated manually using the "raspi-config" command, you can try to install kodi:

Code: Select all

sudo apt-get install kodi
You can either wait for VLC media player to be updated to include hardware acceleration or you can try to build the VLC media player from the source code to enable hardware acceleration, I don't know if you will understand the instructions I do though, here is a link to a guide on how to build VLC media player from source code:

https://thepi.io/how-to-compile-vlc-med ... pberry-pi/

That is a surprise there are no media players for the RPI4 I'm not trying to freeze your computer trying out different media players, I assume RPI4 users can use the media player on a HTML5 website instead of any installed software, if I had a RPI4 I would search for a new media player here is a link to media players available on the Debian repository for Buster:

https://packages.debian.org/buster/video/

JanaW597
Posts: 3
Joined: Sun Jul 07, 2019 7:33 pm

Re: Transition from omxpayer to vlc

Tue Jul 09, 2019 5:47 pm

Thank you so far, I´ll try it on the weekend

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5341
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Transition from omxpayer to vlc

Thu Jul 11, 2019 1:27 pm

VLC is hardware accelerated in Stretch and Buster. See: https://www.raspberrypi.org/blog/raspbi ... mber-2018/

VLC is being actively worked on, so I'd say that is the recommended video player for desktop use (kodi is better as a standalone player).
There should be a VLC update in raspbian soon that has some performance improvements.

Moonmarch
Posts: 151
Joined: Thu Mar 07, 2019 1:34 am

Re: Transition from omxpayer to vlc

Fri Jul 12, 2019 8:37 am

After restarting my computer several times to try out different ideas which involve using vlc media player with opengl enabled, what I said about hardware acceleration I meant to say full KMS drivers, using the Full KMS drivers will cause vlc to stutter, actually other video players that you use with full KMS enabled should have the same problem, which means forget what I said about using different media players I have a different idea.

You can run vlc media player with opengl enabled, did not know about this before, because I didn't use opengl with vlc no instead I always used the default drivers, I don't know if there is any benefit to running vlc with full KMS drivers enabled compared to running with legacy drivers, anyhow here is how you enable opengl video output in vlc:

Open VLC media player > Tools > Preferences > Select Video > Under the display category find Output > Select Output menu > Change Output method from Automatic to OpenGL Video Output > Save

You can escape full screen using the f key, don't know if these settings will improve Mpeg2 video playback, YouTube videos run without any noticeable problems, output methods can cause audio distortion, you can use any of the Output methods in Tools > Preferences > Video to improve video playback, vlc will not display video if the video output method is not compatible with either the full KMS drivers or the fake KMS drivers.
Last edited by Moonmarch on Sat Jul 13, 2019 5:50 pm, edited 1 time in total.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5341
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Transition from omxpayer to vlc

Fri Jul 12, 2019 11:39 am

There are different code paths for different configurations in VLC:
fkms enabled/disabled
command line or X
software or hardware decode
full screen or windowed

They all have hardware accelerated decode for supported codecs (e.g. H.264), but decode isn't the only significant work.

In general the fullscreen mode will play better (we directly display the YUV frames as a hardware layer),
compared to windowed playback that requires resize/convert to RGB/composition.

Currently software decode isn't using the direct display of YUV frames, but that is being worked on,
which will help, e.g. MPEG-2 on Pi4.

HEVC acceleration in VLC (like kodi supports) is also being worked on.

JanaW597
Posts: 3
Joined: Sun Jul 07, 2019 7:33 pm

Re: Transition from omxpayer to vlc

Sun Jul 14, 2019 11:02 am

Thanks a lot guys,

did it a lot of testing and found a solution (or hack) that works for me for the time being. Waiting for further improvements on vlc, as mentioned above. Also I found the project from RPi_Mike (https://www.raspberrypi.org/forums/view ... &start=200), something to try as soon as he updates it to buster.

What works for me is adjusting the framebuffer from 4k to 720p, than my movies run perfectly smooth:

Code: Select all

fbset -fb /dev/fb0 -g 1280 720 1280 720 32
vlc --fullscreen 'MyMovie'
fbset -fb /dev/fb0 -g 3840 2160 3840 2160 32

Return to “General discussion”