OBS constructing a buffer for TCP transmission?

Fierelier

Member
I would assume this applies to all platforms, not just Windows.

Hello forums.
I have been working on a bit of a project, my own multicast streaming server and client. RTMP hasn't really been working out for me, and SRT is not very available yet. As OBS cannot output to a pipe, which is required for my client, I made a little script that acts as a TCP server, which outputs the data to a pipe.

The issue is that, over time, OBS seems to make some sort of buffer to, I assume, ensure smooth transfer. This adds a fair bit of delay over time, 6 - 8 seconds or so. However, if I use ffmpeg to stream, via the same script that converts to a pipe via TCP, the delay does not get larger (which is the desired behavior).

It has been confirmed that the player is not at fault, by tuning out and then into the stream. I am confident that OBS is causing the delay. Is there some way to make OBS not do this? I basically just want it to spit out the data to the TCP server as soon as it is available, no ifs and buts.

I attached a log file, but it doesn't seem to have any useful information in this case. The issue has been reported to me by Windows 10 users, I just did my own research to get to the bottom of the issue, so please don't shout at me for using an old operating system. Thank you.
 

Attachments

  • 2021-04-23 11-21-44.txt
    12.4 KB · Views: 35

TryHD

Member
I'm no expert on this but I think your delay get build up on the player and not OBS, but is caused by OBS or better your system. You have encoding lag and if you don't output the expected kind of frame, e.g. don't encoding a keyframe the H264 stream is not decodable for the player. So my guess is that the player waits in that case until a timeout is reached and than discards the segment.
Anyway I think your best bet would be to ask in the OBS discord.
 

R1CH

Forum Admin
Developer
Outputting to tcp:// uses ffmpeg, so any buffering would come from ffmpeg or OS sockets. OBS only maintains an internal buffer for RTMP output.
 
Top