popcornmix / omxplayer

omxplayer
GNU General Public License v2.0
1.01k stars 334 forks source link

Migrating to VLC #796

Open korbav opened 3 years ago

korbav commented 3 years ago

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 :

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

KenT2 commented 3 years ago

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

korbav commented 3 years ago

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.

kytart commented 3 years ago

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?

premultiply commented 3 years ago

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

popcornmix commented 3 years ago

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

kytart commented 3 years ago

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

popcornmix commented 3 years ago

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

keygee commented 3 years ago

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

popcornmix commented 3 years ago

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

keygee commented 3 years ago

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 commented 3 years ago

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

mirkosamir commented 2 years ago

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?

popcornmix commented 2 years ago

No plans here to fork vlc.