RTP dynamic bitrate depending on network condition

Michael Gruner michael.gruner at ridgerun.com
Wed Feb 13 18:09:43 UTC 2019


Hi Justin

Most browsers have REMB congestion control built in. In REMB, the video receiver sends an estimate of the available bandwidth back to the sender. It does this by using the RTCP channel.

I’m not familiar with Kurento's WebRTC implementation but I’m pretty sure it uses GstRtpBin underneath, so you should be able to receive REMB estimates. First look for the REMB requests in your initial SDP offering:

a=rtcp-fb:<payload type> goog-remb

Then you can read the incoming RTCP messages from the rtpbin. There’s a signal you can connect to. Filter the REMB statistics and you’ll have an estimate of the available bandwidth which you can use to configure your encoder's bitrate. 

I’d say an application would be easier. If you’d like to do it via plain cmdline you’ll need to modify, at least, the rtpbin and the encoder to communicate via messages.

Are you testing with gst-launch? If so, that would explain why it closes on poor network conditions. gst-launch listens to the pipeline bus and shuts down if an error is received. Your application may decide to react different. For example, pause waiting for the network to improve.

Michael
RidgeRun

> On Feb 12, 2019, at 9:10 PM, justin via gstreamer-devel <gstreamer-devel at lists.freedesktop.org> wrote:
> 
> hello there !
> 
> I am currently building a project where we aim to:
> 
> "Live stream a drone video over 4G network in real time (~500 ms Latency)
> and broadcast to a website".
> 
> The process is as follow:
> 
> *Gstreamer*[HDMI video feed -> H264 encode -> RTP -> UDP sink] --->
> *Kurento*[rtp -> webRTC] --> browser
> 
> We successfully live streamed over WAN via ethernet and achieved required
> latency. The result was good.
> However when testing with 4G dongle (for real testing scenario), we are
> facing the issues with UDP streams being halted due to poor network
> condition depending on the location.
> 
> My question is: Is there a way to dynamically change the target bitrate of
> omxh264encoder by checking the bandwidth of the sender? Would this require
> writing a c++ application rather than a commandline pipeline? 
> 
> This is my current pipeline:
> 
> '!', 'video/x-raw,width=1920,height=1080,framerate=30/1',
> '!', 'videoconvert',
> '!', 'omxh264enc control-rate=1, bitrate=800000',
> '!', 'rtph264pay','config-interval=1','pt=96',
> '!', 'udpsink',ipStr,portStr,'-v']; 
> 
> 
> Another question: It seems that Gstreamer stops streaming completely if the
> network condition is too poor. Is there a way for Gstreamer to simply pause
> and wait when the network is bad, and continue streaming when the signal
> gets better? 
> 
> 
> Thanks guys !
> 
> 
> 
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190213/a38429d5/attachment.html>


More information about the gstreamer-devel mailing list