[Live-devel] RSTP Live streaming from USB camera (Ross Finlayson)

Ross Finlayson finlayson at live555.com
Sun Feb 22 22:17:58 PST 2015


> We went inside the problem and we realized that there were several lost packets.
> Looking at the source code, in the "writeSocket" function inside 
> GroupsockHelper.cpp file we saw that there's no check for error for the "sendto" call.

That’s correct - because it is used to transmit a *datagram*.  The only reason why this call should fail is if your OS’s output buffer has filled up - and that will happen only if your data output rate is exceeding the capacity of your network.

It’s important to understand the difference between real-time streaming (which is what a LIVE555-based RTP server does) and on-demand streaming (which is what a HTTP server does).  With real-time streaming, if your streaming rate exceeds the capacity of your network, you *will* lose data (most likely due to your OS’s output buffer filling up).  There is *nothing* you can do to ‘fix’ this, other than by reducing the bitrate of your stream (or increasing the capacity of your network).  (Note also that the capacity of your network is usually a lot less than the nominal bitrate of your server’s network interface.)


> 2) secondly, we programmatically increased the socket buffer by 
> adding the call to "setsockopt" in Live555ServerMediaSubsession :: createNewRTPSink

The best way to do this is to call the LIVE555 “increaseSendBufferTo()” function, rather than calling the low-level “setsockopt()” function directly.  But in any case, note that if your streaming rate exceeds the capacity of your network, then this will only delay the point at which you start losing data; you can never eliminate it.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/ <http://www.live555.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20150223/162d875f/attachment.html>


More information about the live-devel mailing list