omxplayer icon indicating copy to clipboard operation
omxplayer copied to clipboard

Migrating to VLC

Open korbav opened this issue 5 years ago • 14 comments

Hi, omxplayer being deprecated, I'm wondering if there would be a guide to deal with the migration to VLC?

Indeed, omxplayer has a pretty specific behaviour out of the box, just with omxplayer file.mp4. So, naturally that would be a good thing to have some words on reproducing exactly the same native behaviour within VLC.

For now, I'm testing it from a PI4 Raspbian (with Desktop environment) and the obvious differences I see are :

  • omxplayer runs immediately in full screen mode, which is not the case with vlc (--fullscreen fixes that).
  • omxplayer runs without any window frame while VLC, even in fullscreen mode does, when leaving the fullscreen mode or when the file has ended to be played.
  • omxplayer won't allow mouse controls whereas VLC will.
  • omxplayer won't hide the terminal whereas VLC will (overlaying it with a black layer).
  • omxplayer displays no controls whereas VLC does (when exiting the full screen mode or hovering the window with the mouse).

And of course, I can't talk of what not visible differences are happening behind the scene (hardware acceleration, layering process, and so on.).

Most likely, these points have easy command line switches in VLC, but I feel it would be a good thing to have all of this documented somewhere, because the migration is not really trivial, and I haven't been able yet to reproduce the same result I had with omxplayer.

The closest behaviour I can get is using the following :

vlc file.mp4 --overlay --no-video-deco --no-embedded-video --fullscreen --no-interact --intf dummy --repeat For what is visible at least, it looks similar, but I'm still observing problems, for example the loop feature is not seamless at all

korbav avatar Jan 02 '21 10:01 korbav

There are more VLC options here https://github.com/RPi-Distro/vlc/issues/13 and here https://github.com/RPi-Distro/vlc/issues/12

Using cvlc rather than vlc will remove the control panel.

Even using all the options there is still one extraneous window, the x window that would contain the video when mmal is not used. The only way to remove this is to disable the display with DISPAY= clvc.... however this disables the dbus control and means that vlc cannot run in the same process as a program that requires an x window so the python vlc library cannot be used. I have had success with using the -rc cvlc interface to control vlc running in a seperate process to a python program. I have documented my experiments here https://github.com/KenT2/pp-vlc

KenT2 avatar Jan 03 '21 22:01 KenT2

Hi @KenT2, your input actually totally addressed my concern, awesome. If I'm understanding well, you also solved the issue concerning the dbus control by using the remote control interface of VLC? If so, I don't see any other problems, I'll leave this issue open since I still think a migration guide would be benefic for everyone. If there's anything else, let's use your experimentation thread to centralize the efforts. Thanks again.

korbav avatar Jan 12 '21 07:01 korbav

Another important difference is that omxplayer runs standalone without a window manager while VLC, at least the way you described it so far, runs in X11?

kytart avatar Jan 22 '21 10:01 kytart

And VLC does not support HDMI clock adjustments/clock recovery for live feed decoding which is one of omxplayers most important features.

premultiply avatar Jan 22 '21 10:01 premultiply

@kytart vlc can run without x running. It runs fullscreen. If X is running you can force fullscreen mode (--fullscreen)

popcornmix avatar Jan 22 '21 12:01 popcornmix

@popcornmix but it has to use some hw accelerated API supported by RPi to put stuff on the screen, right?

kytart avatar Jan 22 '21 12:01 kytart

Yes, it will use accelerated video decode and render (technically mmal_decode and mmal_render in current version of vlc in RPiOS).

popcornmix avatar Jan 22 '21 13:01 popcornmix

Hi @popcornmix , I wrote a little c application that does a system() call to omxplayer passing the path of a video file as argument. Now I'm trying to substitute omxplayer with vlc. Everything works perfect if I call my application within a terminal, but if my app is launched by a php script (like I did with the omxplayer version), every h264 works perfect, but for hevc contents, I get this error:

Jun 26 12:13:44 raspberrypi vlc[865]: elst box found Jun 26 12:13:44 raspberrypi vlc[865]: STTS table of 1 entries Jun 26 12:13:44 raspberrypi vlc[865]: Looking for HEVC decoder 'hevc' Jun 26 12:13:44 raspberrypi vlc[865]: decoded zero sample Jun 26 12:13:44 raspberrypi vlc[865]: device cannot be paused Jun 26 12:13:44 raspberrypi vlc[865]: Failed to preallocate decoder pool (4+3) * 12441600

Any idea on how to solve this is really appreciated! :-)

Bye

Guido

keygee avatar Jun 26 '21 10:06 keygee

What user is the php script run as? If it's not pi, then make sure it belongs to same groups as pi.

popcornmix avatar Jun 27 '21 18:06 popcornmix

Hi @popcornmix , thanks for your reply I see that vlc is started by the apache2 user (www-data), so I tried to run apache2 from pi. In this way vlc is started by user pi but same result: h264 perfect but no way to see an hevc encoded file

keygee avatar Jun 28 '21 08:06 keygee

I tried a simpler test: I made a php script like this:

<?php
  exec("/usr/bin/vlc -I dummy --syslog --play-and-exit <my_file.mp4> > /dev/null &");
?>

and saved to /var/www/html/test_h265.php.

If my_file.mp4 is a h264 encoded file, I can start it from a terminal (as pi user) with:

php /var/www/html/test_h265.php

or via browser (apache2 is running as pi user):

http://<ip of my RPI4>/test_h265.php

and I can see my video on my HDMI out, but if the file is an hevc encoded file, I can see it only running via terminal I am really going crazy with it....

keygee avatar Jun 28 '21 15:06 keygee

There is anyway to simply play video files w/subtitles headlees in Rpi4?

y dont need install ALL de vlc package and their dependencies, i only use a rpi4 as server to play remote music and movies, dont need graphical interface, and vlc-plugin-base want to install wayland dependencies stuff and other desktop related sfuff.

There are any plans to fork vlc to act simil to omxplayer, that simply work out the box?

mirkosamir avatar Jul 13 '21 14:07 mirkosamir

No plans here to fork vlc.

popcornmix avatar Jul 13 '21 15:07 popcornmix