Delay accumulation using media source with RTSP stream and local IP

andrea.lorenzo

New Member
I'm trying to set up a video wall using media sources with RTSP streaming. All cams added into OBS are with a local IP address.

Hardware in use: Mac Pro (Intel Xeon E5 3,5 GHz 6 core, 32 GB ram 1866 MHz DDR3, Graphic card AMD Fire Pro D500 3GB).

During a working day the stream accumulates about 15 sec and more of delay.

After some test I found that it could be a bad configuration of OBS, because if I hide (the eye icon into sources panel) and reveal a camera, this returns live with zero delay.

Which cameras property configuration can I set to reduce delay?
 

Attachments

  • Property window.PNG
    Property window.PNG
    52.4 KB · Views: 110

andrea.lorenzo

New Member
Update: After some setting changes I found that the stream reaches about 10 sec of delay also with only 1 visible camera.

So, the problem is not related to the amount of active cameras.

Anyone can find the delay reason?
 

aley

New Member
I have the same issue, but the drift is MUCH larger.

App: OBS Studio 29.1.3 for Apple Silicon
Host: Mac mini M1 with 16GB RAM (CPU usage in OBS Studio is ~5% when streaming)
Scene setup: 1080p@25fps
Scene contents: A RTSP stream from an IP cam, a logo and some text and HTML
Use case: 24/7 webcam
Dropped frames: at most a few hundred every day
RTSP source: IP cam, connected by Gigabit ethernet, streaming at 4K@25fps (6Mbit/s)

After 24 hours, the drift is probably 1-2 hours and the memory consumption of OBS has ballooned from 400MB to 14GB.
Memory consumption seems to grow at ~10MB/minute. It seems to me that the RTSP stream is buffered and decoded too slowly.

In OBS Studio, the delayed video from the RTSP stream is shown.
Toggling visibility of the RTSP stream off and on again instantly catches up the stream and memory consumption drops down to 400MB again.

I have (unsuccessfully) tried:
- Enable/disable hardware decoding of the RTSP media source
- Change network buffering setting of the RTSP media source
- Change input delay setting of the RTSP media source

I'd be grateful for any ideas.
 

XLCOLDJ

Member
Do you have your IP cam and computer configured to use NTP? That generally helps with minimizing drift between audio and video over IP.
 

aley

New Member
Do you have your IP cam and computer configured to use NTP? That generally helps with minimizing drift between audio and video over IP.

Both devices have roughly the correct time (plus/minus a second or so, but that can't be helped).

I have, however, found a workaround using Advanced Scene Switcher:
If the memory consumption of OBS Studio rises above 600MB, the RTSP stream is hidden for 100ms and then made visible again, thereby making sure that the RTSP stream is up-to-date again. This seems to work well enough for my use case (where a minute of drift is fine).

I'll do some more testing in a few weeks when I have that specific camera back on my desk.
 

AmandaJansen

New Member
Both devices have roughly the correct time (plus/minus a second or so, but that can't be helped).

I have, however, found a workaround using Advanced Scene Switcher:
If the memory consumption of OBS Studio rises above 600MB, the RTSP stream is hidden for 100ms and then made visible again, thereby making sure that the RTSP stream is up-to-date again. This seems to work well enough for my use case (where a minute of drift is fine).

I'll do some more testing in a few weeks when I have that specific camera back on my desk.
Thanks, my issue has been fixed.
 
Top