This is a solution post rather than a problem post. I have now abandoned vlc as a streaming solution.
Last year I had a very long topic about streaming problems of the classic Raspberry Pi webcam raspivid | cvlc RTSP solution.
I had issues with a stalling system and stuttering video stream.
Viewing the stream would have 40-50% dropped frames.
This rendered the stream unreadable by motioneye.
TL;DR…
I discovered VLC is not optimal anymore - it’s broken for mortals.
I upgraded DietPi to the ‘modern’ libcamera stack.
I used a RTSP streamer solution: Mediamtx.
I used DietPi Bullseye (not Buster), Bookworm was too new.
VLC no longer
Raspberry forum comment here about ‘de-vlcing’
and
Ubuntu question here which has these answers:
From this Debian bug report
'We had to disable those plugins as liblivemedia constains non-free code. See #981439. Maybe that’s worth a NEWS entry and a note in the release-notes”
And from VLC forums:
“Debian VLC builds do not support RTSP by Debian policy decision"
RTSP server
So, I have switched to RTSP streaming solution Mediamtx (rebranded RTSP-simple-server)
I tested first by installing Raspbian OS for lib camera and mediamtx, and all went very well.
My motioneye page immediately started showing the stream that had been dead for months.
I went back to DietPi - because I like to be slim.
Libcamera on Dietpi
This was little more tricky, as libcamera is not native on DietPi yet. modern vs legacy.
I tried Bookworm - but that failed on some dependencies, and too new and tricky for me.
I went back to Buster.
A. install and enable libcamera per this topic
essentially
- Enable ‘8: RPi Camera’ at DietPi-Config/Display Options/
- added ‘camera_auto_detect=1’ to the /boot/config.txt
and comment out start_x=1- Installed libcamera ‘apt install libcamera-apps-lite’
B. install mediamtx
apt install libfreetype6
download and unpack mediamtx
C. set RTSP RpiCamera parameters
Edit the mediamtx.yml file to add the camera path…
paths:
stream:
source: rpiCamera
I used path ‘stream’ rather than ‘cam’, as that already used by motioneye.
(The instructions are little obscure to understand the full URL based on paths.)
D. run Mediamtx as sudo.
sudo ./mediamtx
E. add systemd service
F. view stream in motioneye
and spend many happy hours tweaking detection parameters!