-
Notifications
You must be signed in to change notification settings - Fork 33
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
Retry mechanism #11
Comments
I've tried a couple of approaches. The first method had the logic for connecting and saving the stream encapsulated within a class. This class has logic to catch disconnection errors and reopen the connection. However after a few days this would drop the connection in a way that wasn't caught. I was never sure how it slipped through as the stream just... stopped. The second method involved creating a separate "watcher" method / service. It checked the folder the video files were saved into for changes to files. If there were no changes for at least X seconds it would assume that the stream had crashed. It would then tell the stream class kill the stream (if still open), and try to open it again. I'd be interested to hear what solution you've come up with! |
This is actually what I ended up doing : https://gist.github.com/7aklhz/87bdf1bf2e1e06f77633b4949a0d948c I make an infinity loop that tries to curl the url. If 200 ok then start ffmpeg if not retry curl after 5 seconds. |
Nice, thanks! |
Hi. Thank you for sharing your code and experience. I'm looking at https://medium.com/@tom.humph/saving-rtsp-camera-streams-with-ffmpeg-baab7e80d767 and was wondering if you know how to implement and handle retry / relaunch on (stream) error?
The text was updated successfully, but these errors were encountered: