Composite: How to limit outgoing (audio) bandwidth?

746 views
Skip to first unread message

wolfga...@gmail.com

unread,
Jul 12, 2016, 5:05:00 AM7/12/16
to kurento
Hi,

I want to use kurento for an audio-only conferencing application. It must work under bad network conditions. 
I successfully applied Endpoint.setMaxAudioRecvBandwidth() to limit bandwidth in the endpoints (bitsSentPerSecond, bitsReceivedPerSecond down to ~ 15kbits).

Another requirement is to mux audio channels.

However, once I introduce a Composite, even in a minimal One2One setup with a Composite (no actual mixing) instead of a direct audio connection, bitsReceivedPerSecond increases to ~ 70kbits.
I tried to apply HubPort.setMaxOutputBitrate() on each of the ports. To no avail, bitsReceivedPerSecond remains at ~ 70kbits.

Two questions:
1) A Composite (audio) by default seems to operate with a higher bitrate than a direct line. Is this expected?
2) Is there a way to limit outgoing bandwidth for a Composite?

Thanks in advance!

Wolfgang

----

Ivan Gracia

unread,
Jul 13, 2016, 8:52:38 AM7/13/16
to Kurento Public
Can you provide a test project for this?

On Tue, Jul 12, 2016 at 11:04 AM, <wolfga...@gmail.com> wrote:
Hi,

I want to use kurento for an audio-only conferencing application. It must work under bad network conditions. 
I successfully applied Endpoint.setMaxAudioRecvBandwidth() to limit bandwidth in the endpoints (bitsSentPerSecond, bitsReceivedPerSecond down to ~ 15kbits).

Another requirement is to mux audio channels.

However, once I introduce a Composite, even in a minimal One2One setup with a Composite (no actual mixing) instead of a direct audio connection, bitsReceivedPerSecond increases to ~ 70kbits.
I tried to apply HubPort.setMaxOutputBitrate() on each of the ports. To no avail, bitsReceivedPerSecond remains at ~ 70kbits.

Two questions:
1) A Composite (audio) by default seems to operate with a higher bitrate than a direct line. Is this expected?

Not that we have noticed
 
2) Is there a way to limit outgoing bandwidth for a Composite?

This should be taken care by the WebRtc endpoint, not by the Composite.
 

Thanks in advance!

Wolfgang

----

--
You received this message because you are subscribed to the Google Groups "kurento" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

wolfga...@gmail.com

unread,
Jul 13, 2016, 10:24:51 AM7/13/16
to kurento
boolean useComposite = true;

lets you switch between Composite / direct line.

Using Composite you notice higher bitsReceivedPerSecond value in chrome://webrtc-internals/.

Another observation: Endpoint.setMaxAudioSendBandwidth() seems to be missing from API. It’s mentioned in the JavaDoc though.

Thanks & best regards
Wolfgang
kurento-one2many-call.zip

Ivan Gracia

unread,
Jul 13, 2016, 11:32:40 AM7/13/16
to Kurento Public
Composite endpoint is transcoding, and in that process the RTCP packages are lost, so to speak, so that bandwidth control has also to be set in the upstream WebRTC separately.

You are right, the documentation is wrong. The problem is that not all codecs allow for that configuration, so we decided not to include it. We'll make sure to update the documentation.

Ivan Gracia


wolfga...@gmail.com

unread,
Jul 14, 2016, 4:41:56 AM7/14/16
to kurento
how would that look in code? I wasn't able to influence audio bitsReceivedPerSecond from a Composite by applying any of these: 
  • webRtcEP.setMaxAudioRecvBandwidth(n);
  • webRtcEP.setMaxOutputBitrate(n);
  • hubPort.setMaxOutputBitrate(n);

Thanks!
Wolfgang

Ivan Gracia

unread,
Jul 14, 2016, 4:48:31 AM7/14/16
to Kurento Public
setMaxOutputBitrate only affects video. I'm afraid you can't limit the upload audio bitrate if you are transcoding, sorry! It's because not all codecs allow you to do that, so we decided not to put it finally.

One question out of curiosity: are ~70KB that much for your use case? I don't really see that it would add up to much, so I though I'd ask.

Cheers,

Ivan Gracia


wolfga...@gmail.com

unread,
Jul 19, 2016, 3:44:02 AM7/19/16
to kurento
Hi,
it becomes an issue if you want to tackle really low bandwidth e.g. GPRS. 
To get a feel of the effort involved, how could we technically limit bitrate in an audio composite? Add some filter? Any idea?

Thanks!
Wolfgang 

Ivan Gracia

unread,
Jul 20, 2016, 9:08:40 AM7/20/16
to Kurento Public
That depends on the audio codec. I can tell you that if we haven't done it, it's because it wasn't straightforward for all use cases and codes. Perhaps you can reduce the number of codecs that your app can use, and apply a GStreamerFilter filter before connecting the output of the hub to the WebRTC endpoint.

Ivan Gracia


wolfga...@gmail.com

unread,
Jul 26, 2016, 9:21:57 AM7/26/16
to kurento
Hi Ivan,

audio is Opus only. 
I’ve come up with a workaround (which looks a bit overloaded to me):

GStreamerFilter opusDecoder = new GStreamerFilter.Builder(pipeline, "opusdec").withFilterType(FilterType.AUDIO).build();

String command = "opusenc bitrate=" + bitrate;

GStreamerFilter opusEncoder = new GStreamerFilter.Builder(pipeline, command).withFilterType(FilterType.AUDIO).build();


port.connect(opusDecoder, MediaType.AUDIO);

opusDecoder.connect(opusEncoder, MediaType.AUDIO);

opusEncoder.connect(endpoint, MediaType.AUDIO);

What’s your take on this? 

Thanks!
Wolfgang

Ivan Gracia

unread,
Jul 26, 2016, 9:38:58 AM7/26/16
to Kurento Public
It could be a bit convoluted, but probably your only chance if you don't want to get into the inners of WebRtcEndpoint in KMS.

Check the performance impact if any, though!

Ivan Gracia


Reply all
Reply to author
Forward
0 new messages