Reolink updates Learn More
Meet Reolink at IFA 2024! Learn More
Reolink Q&A Learn More
Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
My BeeCam is a Raspberry Pi3/Raspbian Stretch w/freshly compiled ffmpeg version N-89882-g4dbae00bac running this as a service:
#!/bin/bashcd /usr/local/bin/while truedo./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 10sdone
[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
I am having the same issue with my RLC-410 and RLC-420.The stream works great if I let them rest for ~30 seconds between running my application (which is using ffmpeg).Something is not getting cleaned up properly on the camera-side when the stream is closed.2019-04-23_14-29-17.png
So that 30 second pause fixes things? I'll try putting a 30 second pause in my watchdog timer.Thanks!
Have the same problem here. 30 second pause doesnt fix the problem.
Could you please send an email to support@reolink.com? Our support team will check it for you soon. Thanks.
I had the same issue as the posters above, and found a solution here: https://superuser.com/a/1562786/231129Regarding the 30 second pause: It seems it differs by model. Some cameras (my C2 and alex's RLC 410 and 420) appear to have an "auto cleanup" of streams after a wait of about 30 seconds (after stream termination from the computer end), whereas for others (the cameras Steven Kan and bigger_law have), it appears there isn't such a function (thus requiring a camera reboot).Anyway, check and see if the solution I linked to works for you. (I'm guessing it will solve at least some of other people's cases)
Thanks! I'm incredibly impressed that you were able to duplicate and fix such as obscure problem!I'm copying and pasting your solution from GitHub:
FFMpeg.prototype.stop = function() { // replace this... //this.child.kill(); // with this... this.child.stdin.write("q\r\n"); delete this.child; this.emit('stop');};
No, the fix I made was in the NodeJS library that was launching (and non-graciously killing) the ffmpeg process.This is the file I changed: https://[censored]/agsh/rtsp-ffmpeg/blob/master/lib/rtsp-ffmpeg.jsSo for your case, I would look to the source code of whatever program is "killing" the ffmpeg process. If nothing (in your program) is explicitly killing the subprocess, then I guess you'll need to add a "cleanup" function that graciously ends the subprocess prior to your program overall being terminated.
Ah, I see. Right now I'm calling ffmpeg through a bash script:
#!/bin/bashcd /usr/local/bin/while truedo./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 10sdone
[Unit]Description=StreamerAfter=network-online.targetRequires=network-online.target[Service]ExecStart=/usr/local/bin/StreamToYouTube1.shRestart=alwaysKillSignal=TERM[Install]WantedBy=multi-user.target
Unfortunately I don't know much (basically anything) about Linux/Mac services, so I won't be much help for the specifics.One thing I can say is that it probably involves this:KillSignal=TERMIn the NodeJS library I referenced, that is the same kill-signal it had been sending to the ffmpeg process to end it (which was causing the issue).So, you'd need to find some way to have the "stop service" command send the "gracious exit" input I mentioned ("q\r\n"), rather than the "TERM" (ie. "SIGTERM") kill-signal.It's possible the "sudo systemctl stop StreamToYouTube" approach you're using doesn't support this, meaning you'd need to find an alternative way of sending the "gracious quit" message. (though maybe it does support it, I don't know ^_^)
Ah, ok. Thanks! I'll ask over on arstechnica, where they know Unix. You still get a cookie for finding the solution!
Haha thanks! I like your stream by the way.
Welcome Back!
Hi there! Join the Commnunity to get all the latest news, tips and more!