Autoreconnect RTSP stream

Barabba

Member
Hi, I connect to a camera with RTSP over internet, the connection may be unstable, this morning I saw the image "frozen" cause probably during the night something happened or the camera restarted.
Maybe OBS do try reconnect to camera itself, but not considering all scenarios. Maybe it tries but not forever, and after some minutes the camera is rebooting or internet out of service it doesn't attempt more. There is a timeout about attempting?
Or maybe a corrupted protocol can interrupt connection and don't let OBS attempt more?
There is a way to log these problems? Should I activate a verbose log somehow? Please teach me how can I report here good informations, thank you
 

Barabba

Member
It happened again, and I don't know how to help you understand where the problem is.. I've checked the log, they contain only log of the start of OBS and its shutting down, events which appeared during functioning (that's what I'm looking for) aren't present. How can I activate a log each time RTSP stop? How can I tell OBS to force reconnect forever?
Thanks
 

Barabba

Member
Hi, sorry for delay, yes I've simulated a network failure, I used Tcpview to monitor the OBS attempts and I've found 5 attemps only (once every 1-2 seconds). After them failing OBS doesn't try more to connect. It is possible please to fix it? To make it attempting forever?
 

Barabba

Member
Try to change the numbers in "Setting" -> "Advance" -> "Automatically Reconnect"
This was the first thing I've checked, and it was already set. I even tryed to set it off, close, open amd set it on again.
Please staff introduce an agressive forever reconnect feature, thank you
 

Lawrence_SoCal

Active Member
I'm not staff, and this is free open-source software
With that said, "an agressive forever reconnect feature" is both a REALLY bad idea and completely unnecessary request as you can do that already. And really isn't inline with what I understand the design principles of OBS to be (an interactive tool). And hopefully you realize how a too aggressive rec-connect attempts could actually prevent a re-connection. With that said, the default 5 second pause in my case (no other devices using LAN/ISP connection) was too long for me, and I did drop that to 3 seconds instead. And you can set how many attempts to retry .. so basically you can be aggressive already, for a very long period of time (hours, days, weeks - all of which would be silly/stupid, but this sophisticated software will let you shoot yourself in the foot, so to speak, so have at it)....
 

fandango957

New Member
1. Use "Media Source"
2. Check "Restart playback when source becomes active" (first you have to untick Local File)
3. input = rtsp://cameraAccessUsername:cameraAccessPassword@ipAddressOfCamera:554/Streaming/Channels/1 - for the Streaming/Channels/1 it depends on the camera itself, it can be something different. (In other words use - what you use to connect to your camera.)
4. Tick the = "Close file when inactive" !!!

When your source is inactive - it will be closed. In the beginning we ticked - restart playback. So when it becomes active it should automatically connect.
For network buffering = 3MB and reconnect delay = 7 sec.
Hopefully it will get the job done.
(I am not staff or anything - I simply have the same problem. Just made an account to comment - not sure whether it will get the job done - but it looks promising. I'm testing it out myself as well.)
(You can also use VLC in OBS - for some it works, for me personally it doesn't (you just add the link to your camera a lot of times in a vlc playlist and add that playlist a lot of times in obs while using vlc media source).
 
Last edited:

Barabba

Member
Thank you for your replies!
Lawrence_SoCal: unfotunately the program doesn't do what expected it does, to reply you I'm using media, I hope they are more clear than my words, OBS stop attempt afer few seconds these settings are completely ignored.

fandango957 thank you a lot to reply here and help me, I'm gald I'm not the only one having this problem, I understood your way.. create a playlist and use it to overcome the OBS limitation. I'll test it but I really home the staff will fix this problem. Thank you
 

Barabba

Member
for some reasons the picture was not loaded, these are the settings I'm using
tcp.jpg
tcp.jpg
 

fandango957

New Member
Automatically reconnect is for the server itself - like youtube and facebook. If your internet crashes a lot - obs will stop streaming to the platform or the connection will be closed (I've experienced it with facebook and wifi connection on a laptop). The automatic reconnect - fixes this ! It has nothing to do with the rtsp camera. It's just for the streaming connection.

Use media stream + close file when inactive + restart when becomes active - this is what I see as a solution right now.
Will wait for updates hopefully.
 

Barabba

Member
Well written, the autoreconnect is for streaming only, not RTSP. We're suffernig here of a big problem, I hope they will introduce this soon. Thank you
 

Barabba

Member
temporarely is possible to overcome the problem deactivating and reactivating the "view" of that rtsp, it can be done switching to a scene without that stream and coming back, or simulate a keystroke, etc.
It's not a clean solution, but it's better than wait long for a code improvement
 

panoptesIntern

New Member
I have the same network problem.

I would like to set up my Sony alpha 7s iii camera as a Media Source and use the "media [source] + close file when inactive + restart when becomes active" method, as suggested by @fandango957

At this step (#3): "input = rtsp://cameraAccessUsername:cameraAccessPassword@ipAddressOfCamera:554/Streaming/Channels/1 - for the Streaming/Channels/1 it depends on the camera itself" what do I put for the cameraAccessUsername, password, ipAddress? Or at least where can I find this info?

Thanks!
 

Xorcist

New Member
Would be great if this got fixed. It doesn't work. Clicking the "Close File When Inactive" doesn't work. Have tried extensively.
 

chelsea.

New Member
Also having the same issue. Cameras freeze constantly. I'm assuming it's because of latency etc, it's a farm in an old home and I know for a fact with my extensive network buildout there are pinch points. All I want is something that will refresh the input, either on a timer or automatically (ideally), because opening properties and hitting 'ok' fixes it immediately. But it won't fix itself.
 
Top