My BeeCam is a Raspberry Pi3/Raspbian Stretch w/freshly compiled ffmpeg version N-89882-g4dbae00bac running this as a service:
#!/bin/bash
cd /usr/local/bin/
while true
do
./ffmpeg -re -thread_queue_size 512 -rtsp_transport tcp -i \
"rtsp://anonymous:password@192.168.1.11:554" -i WilliamTellOverture.mp3 \
-vcodec copy -acodec copy -t 00:11:51 -f flv \
"rtmp://a.rtmp.youtube.com/live2/my-youtube-streaming-key"
sleep 10s
done
where 192.168.1.11 is my spiffy new Reolink RLC-423S, and -t 00:11:51 is the length of my royalty-free MP3. This normally works quite well:
https://www.youtube.com/user/IAmTheWaterbug/live
and it loops continuously. The YT stream will glitch when it restarts, but the stream resumes with only about 15 seconds of video lost. It ran continuously overnight for at least 8 hours (e.g. many loops) before I started fiddling with it.
I changed the sleep to 5s, and that doesn't seem to bother it.
But on occasion I've done a sudo systemctl stop StreamToYouTube followed by sudo systemctl start StreamToYouTube, within 1-2 seconds (e.g. as fast as I can type Up Up Up and Enter), and sometimes when I do that, the stream fails, and ffmpeg starts dumping:
[rtsp @ 0x302c2f0] RTP: PT=60: bad cseq e680 expected=0b49
[rtsp @ 0x302c2f0] RTP: PT=60: bad cseq 93ab expected=0b49
[rtsp @ 0x302c2f0] RTP: PT=60: bad cseq 93ac expected=0b49
[rtsp @ 0x302c2f0] RTP: PT=60: bad cseq e682 expected=0b49
endlessly.
Rebooting the Pi doesn't fix this (e.g. the YT stream still fails, and sudo systemctl status StreamToYouTube returns the same stream of "bad cseq" errors), but rebooting the camera does fix it. I'm wondering what exactly that error means, and how to report this to Reolink.
During the "failed" state, the camera appears to be working properly from other clients, e.g. I can launch the Reolink.app on my Mac or view the camera's web page from any browser, and the video looks fine.
But for some reason the RTSP stream goes funky in a way that ffmpeg can't resolve.
It's quite repeatable if I stop/start the service quickly, but restarting with a 5 second pause in my script doesn't seem to bother it.
Thanks!