Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating to VLC #796

Open
korbav opened this issue Jan 2, 2021 · 13 comments
Open

Migrating to VLC #796

korbav opened this issue Jan 2, 2021 · 13 comments

Comments

@korbav
Copy link

korbav commented Jan 2, 2021

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

@KenT2
Copy link

KenT2 commented Jan 3, 2021

There are more VLC options here RPi-Distro/vlc#13 and here RPi-Distro/vlc#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
Copy link
Author

korbav commented Jan 12, 2021

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
Copy link

kytart commented Jan 22, 2021

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
Copy link

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

@popcornmix
Copy link
Owner

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

@kytart
Copy link

kytart commented Jan 22, 2021

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

@popcornmix
Copy link
Owner

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

@keygee
Copy link

keygee commented Jun 26, 2021

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
Copy link
Owner

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

@keygee
Copy link

keygee commented Jun 28, 2021

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
Copy link

keygee commented Jun 28, 2021

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
Copy link

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
Copy link
Owner

No plans here to fork vlc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants