Bug Report rtsp input freezes after 5 minutes

itsdouet

New Member
Hello folks. When running OBS with a Media Source set to Input host (not local), which comes from an rtsp live camera feed, after 5 minutes of running, the feed stops, freezes in OBS and of course then also at the target Stream.
In order to get around the issue, one MUST double click on the Media Source in the Sources pannel, and simply click OK again. That seems to "reset" the feed and it then resumes fine for the next 5 minutes, when it freezes again.

Looking at the logs doesn't show the interuption. All you see are the Media Source configuration details, as if you JUST created it brand NEW.

15:40:59.805: close_when_inactive: yes
15:41:58.709: [Media Source 'Media Source']: settings:
15:41:58.709: input: rtsp://<cameraIP@:7447/rtsp_key>
15:41:58.709: input_format:
15:41:58.709: speed: 100
15:41:58.709: is_looping: no
15:41:58.709: is_hw_decoding: no
15:41:58.709: is_clear_on_media_end: no
15:41:58.709: restart_on_activate: yes
15:41:58.709: close_when_inactive: yes


This is true for the Mac AND Linux version. I haven't tested the Windows version.

Thank you.
 

Tuna

Member
I don't know a about your network scenario here. But this sounds like a NAT router or firewall may present sending/receiving some data. If its after 5 minutes always (how accurate is this?) this sounds like a time out issue. For example - the receiver is most likely supposed to send an RTCP SR back to the camera. This occur in 5 or 10 second intervals I believe. If they do not correctly end up at the camera it may at some point believe that the receiver is no longer available and shuts down the stream.

Have you tried the VLC source instead of the media source? Perhaps it is also possible to switch transport method so yo don't hit the current issue (if that really is the reason why the stream stops).
 
Last edited:

itsdouet

New Member
@Tuna Great idea trying with VLC, but alas same behavior it seems.

Yes, I DO have NAT going on, along with vlans. This is a camera located in Mexico behind a firewall, NAT1, on a vlan going to a ubnt antenna, hitting a sector antenna, going into a router (solar powered), going into an AirFiber antenna, over the ocean on a 25km wireless link, to a receiving AirFiber antenna, into a router with NAT, Firewall in place, out to the Internet modem. This then goes into my OBS on my Mac or Linux server sitting in Switzerland.... All wireless. But I have tested it with cloud servers sitting in San Francisco and same results.

I might run a traceroute from the camera to the OBS client and see where the hang is/are.

Thanks, made me think outside the box a little. Let me know if you have more suggestions.
 

Tuna

Member
I know very little about the VLC source or the media source in OBS.

If you feel adventurous - try to receive it on your Linux machine with GStreamer. It's RTSP source offers many options to perhaps circumvent your issue. E.g. try different protocols like so:

gst-launch-1.0 playbin uri=rtsp://<cameraIP@:7447/rtsp_key>
gst-launch-1.0 playbin uri=rtspt://<cameraIP@:7447/rtsp_key>
gst-launch-1.0 playbin uri=rtsph://<cameraIP@:7447/rtsp_key>

Although I'm not sure whether your camera support these modes. Also there are additional options from the "rtspsrc" element. Check them with:

gst-inspect-1.0 rtspsrc

Maybe you can figure something out that keeps the stream playing. If something works - there is a GStreamer plugin in the plugin section here with which you can feed these pipelines directly into OBS.
 

RaizT1

New Member
If you use VLC (latest version), RTSP might freeze as well.
Solution, download a slightly older version: https://download.videolan.org/pub/videolan/vlc/2.2.8/win64/
Yes. RTSP has been freezing for me in 3.0.6. It's been driving me nuts! The same freezing happens in OBS. Right now, my only stable configuration is using an old version of VLC, and then importing that video into OBS using "Game Capture -> Specific Window".

If you know of a better method, PLEASE let me know. The method above forces me to use the audio coming into OBS from VLC as "Desktop Audio". I need the audio coming from VLC to be a separate audio source!
 
Top