RPi-Distro / vlc

GNU General Public License v2.0
41 stars 4 forks source link

Is VLC a replacement for deprecated omxplayer on raspberry pi? #81

Closed gitterman closed 1 year ago

gitterman commented 1 year ago

I have a security cam solution built with a legacy pi model B. The pi uses a USB webcamand a 800x480 sdtv car monitor. The pi runs without a keyboard and no logged-in user. I use mjpg_streamer to create a ring buffer with still images and a stream which I can use for live viewing. mjpg_streamer -i /usr/local/lib/mjpg-streamer/input_uvc.so -d /dev/video0 --no_dynctrl -r 800x448 --fps 10 -o /usr/local/lib/mjpg-streamer/output_http.so --nocommands -w /usr/local/www -p 8015 -o /usr/local/lib/mjpg-streamer/output_file.so -f /RamDisk/PiDoorCam/MJPG_streamer -s 60 --exceed 20 -b I used to use omxplayer to get the live view on the monitor, and it ran satisfactorily without taking too many resources. Omxplayer is becoming deprecated, and I am struggeling to get the live view with VLC. It complains though, that it cannot be run by root if I try to invoke it remotely from SSH. I then attached a keyboard and use a local login for test purposes, but when I run: cvlc http://localhost:8015/?action=stream I just get "no suitable interface module" and "interface 'global.hotkeys,none' initialization failed" With omxplayer I could just use: omxplayer -r -b --no-keys --fps=10 --live http://localhost:8015/?action=stream Is this possible with VLC too?

jc-kynesim commented 1 year ago

Honestly if you have an old Pi that you are using for a single purpose like this I'd leave it in legacy mode, stick with what works and never update it. The move towards greater standards usage has a number of advantages, but it nearly always comes with much heavier weight code and often gains limitations that are almost impossible to work around and make sense in a secure general purpose system but make no sense for dedicated applications like what you have here.

gitterman commented 1 year ago

I'd leave it in legacy mode,

The old system is running on weezy and I'd love to leave it like that, but I do have some trouble with mail and ssh as the legacy ssl is a security risk and obsoleted. Also, I'd like to get away from init.d and have all my systems running with systemd to keep administration clean and lean.

popcornmix commented 1 year ago

You can still use omxplayer with latest RPiOS bullsye image if you: Use 32-bit image Switch from kms driver to fkms driver.

omxplayer is no longer supported but should still work as before, so if it meets your needs you can continue to use it. But, there won't be new features or bug fixes. It is possible future versions of RPiOS could stop omxplayer working, but we'll avoid doing that if we can.

gitterman commented 1 year ago

I did try to use omxplayer and if I run a local video, like e. g. omxplayer buckbunny_30sclip.mp4 it plays well on my little 800x480 car monitor. If I try to run the live stream like e. g. omxplayer --live http://localhost:8015/?action=stream it only shows the output below, but no video.

Video codec omx-mjpeg width 800 height 448 profile -99 fps 25.000000
Subtitle count: 0, state: off, index: 1, delay: 0

If I use the url in the browser on my Windows desktop (with the IP of my raspi instead of localhost), then I do see the video stream though. It used to work on weezy, but it doesn't work on buster and I even tried to go back to stretch and compiled ffmeg and omxplayer from https://github.com/popcornmix/omxplayer.git (which took about 3 hours!) but still I don't see the live stream. Maybe I am missing something substantially here, but as I stated, I had no problem when I did it on weezy 5 years ago.

As omxplayer is becoming obsolete, I am willing to move to VLC, but so far I did not succeed to play the stream with it either.

gitterman commented 1 year ago

I eventually found this thread https://stackoverflow.com/questions/55439184/getting-unable-to-decode-app-fields-while-playing-usb-webcam-stream-through-ff/56403628#56403628 which made me try a different webcam and voila! With the different webcam I have no problem anymore to show the live stream and everything works as I expect with omxplayer