Janus and Sender bitrate via SDP Munging

238 views
Skip to first unread message

Ju Ju

unread,
Mar 11, 2020, 7:10:13 PM3/11/20
to meetecho-janus
Hi everyone,

I'm facing a weird issue.

I want to unlock sender encoding bitrate to send high quality video, let's say 10Mbits/s.
We assume the network is not an issue here.

When I try to do this using sap munging here : https://webrtc.github.io/samples/src/content/peerconnection/munge-sdp/
adding under m=video the b=AS:10000 line it works.
in Webrtc-internel I can confirm the encoding bitrate is really close from what I asked.


Now when I try the same thing in echo test or video room, my bitrate is always stuck to 2.5 Mbits (I assume chrome default max bitrate)
using janus Admin API I can confirm my line is well present in remote SDP


So I don't understand why it doesn't work. I spent many hours to figure out with no success

thanks for your help

J- 

Ju Ju

unread,
Mar 11, 2020, 7:13:45 PM3/11/20
to meetecho-janus
edit: of course I also set the bitrate limitation in the web page to "unlimited" 

Tristan Matthews

unread,
Mar 11, 2020, 7:25:13 PM3/11/20
to Ju Ju, meetecho-janus
Hi,

On Wed, Mar 11, 2020 at 7:13 PM Ju Ju <trank...@gmail.com> wrote:
>
> edit: of course I also set the bitrate limitation in the web page to "unlimited"
>
> --
> You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/e38696ec-c0c6-4f0c-8c9e-d3ab92c61e1d%40googlegroups.com.

You should compare with e.g., https://appr.tc/r/878325702?vsbr=10000
which, at least according to bitsPerSecond in
chrome://webrtc-internals, is sending ~10M

Ju Ju

unread,
Mar 11, 2020, 7:36:14 PM3/11/20
to Tristan Matthews, meetecho-janus
Hi tristan,

Yes it works as expected but what is the link with janus ?

br

J-

Tristan Matthews

unread,
Mar 11, 2020, 8:37:38 PM3/11/20
to Ju Ju, meetecho-janus
On Wed, Mar 11, 2020 at 7:36 PM Ju Ju <trank...@gmail.com> wrote:
>
> Hi tristan,
>
> Yes it works as expected but what is the link with janus ?

I meant that I'd recommend comparing your client-side implementation
with that of https://github.com/webrtc/apprtc, since the encoding is
done client-side I would not expect Janus to be the limiting factor
here. In the context of the janus demo pages, I think unlimited just
means "as high as chrome will go" which seems to be about 2.5
mbps/3mbps by default unless you're doing whatever apprtc is doing to
blow by this limit (when requested).

Best,
-t

Ju Ju

unread,
Mar 12, 2020, 8:40:49 AM3/12/20
to Tristan Matthews, meetecho-janus
Hi Tristan,

Your idea is good but it is what I made step 1



Give the same result

In webrtc-internals, in the localsdp (set local desc) I can see the « b:AS:XXX »

But when I used janus this is missing, The browser didn’t send the sdp I have munge !

What I don’t understand is I can see it using janus Admin API in the remote SDP (== the sdp of the browser) !!
->how is it possible to have a different « browser sdp » between browser webrtc-internals and janus??

Ju Ju

unread,
Mar 12, 2020, 8:17:02 PM3/12/20
to meetecho-janus
update: I think I get what is happening :

I munge the sdp in the browser side, so local side and the parameter is well present but ignored !
it must be in the remote SDP, so the one generated by janus.
I guess it can't be done in js and I will have to tweak the c source of the plugin I wanna use (or maybe sdp utils ?)

br

J-

To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janus+unsubscribe@googlegroups.com.

Lorenzo Miniero

unread,
Mar 13, 2020, 4:58:18 AM3/13/20
to meetecho-janus
customizeSdp callback in janus.js allows you to munge both outgoing AND incoming SDPs.

L.

Ju Ju

unread,
Mar 13, 2020, 12:13:45 PM3/13/20
to meetecho-janus
Hi Lorenzo,

Actually, from my understanding of janus.js, the customizeSdp call back affect only the localSDP (the one of the browser).
In my case I have to munge the remoteSDP.

I must say I have to dig a little to find out where "to hook" my function in janus.js but I finish to succeed ^^

Now I can play with high bitrate and high quality using a DSLR camera. 
I just have to make some test to :
- pick between available codec (this study seems to point out vp9 weakness and claim H264 is better...http://iphome.hhi.de/marpe/download/Performance_HEVC_VP9_X264_PCS_2013_preprint.pdf
-pick the best trade-off  bitrate (between 2 and 10 Mbits)

J-


Lorenzo Miniero

unread,
Mar 13, 2020, 12:16:30 PM3/13/20
to meetecho-janus
customizeSdp is available in both createOffer and createAnswer, so allows you to make changes before both setLocalDescription and setRemoteDescription are called (depending on whether you're sending or receiving an SDP). As such, it's are all that you need, since what you want is trick the browser in behaving some specific way.

L.
Reply all
Reply to author
Forward
0 new messages