Are multiple codecs being used during an ongoing call?

165 views
Skip to first unread message

Abhinav Ananth

unread,
Aug 9, 2023, 4:30:43 AM8/9/23
to discuss-webrtc
Hello,

So I was under the impression that multiple codecs might be send and received in the SDP but once it is set to the stack (setRemoteDescription, selLocalDescription), only one of them would be used for audio and one for video. But checking the output of the following code shows mulitple codecs - 

peerConnection.getSenders()[0].getParameters().codecs ->.
[
{
"channels": 2,
"clockRate": 48000,
"mimeType": "audio/opus",
"payloadType": 111,
"sdpFmtpLine": "maxaveragebitrate=32000;maxptime=20;minptime=10;ptime=20;stereo=0;useinbandfec=1"
},
{
"channels": 1,
"clockRate": 16000,
"mimeType": "audio/AMR-WB",
"payloadType": 102,
"sdpFmtpLine": "maxptime=20;mode-change-capability=2;octet-align=0;ptime=20"
},
{
"channels": 1,
"clockRate": 8000,
"mimeType": "audio/AMR",
"payloadType": 100,
"sdpFmtpLine": "max-red=0;maxptime=20;mode-change-capability=2;mode-set=0,2,4,7;ptime=20"
},
{
"channels": 1,
"clockRate": 48000,
"mimeType": "audio/telephone-event",
"payloadType": 110,
"sdpFmtpLine": "maxptime=20;ptime=20"
},
{
"channels": 1,
"clockRate": 8000,
"mimeType": "audio/AMR",
"payloadType": 97,
"sdpFmtpLine": "maxptime=20;ptime=20"
}
]

peerConnection.getSenders()[1].getParameters().codecs ->
[
{
"clockRate": 90000,
"mimeType": "video/VP8",
"payloadType": 96
},
{
"clockRate": 90000,
"mimeType": "video/H264",
"payloadType": 127,
"sdpFmtpLine": "level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42C01F"
}
]

peerConnection.getReceivers()[0].getParameters().codecs ->
[
{
"channels": 2,
"clockRate": 48000,
"mimeType": "audio/opus",
"payloadType": 111,
"sdpFmtpLine": "minptime=10;useinbandfec=1"
},
{
"channels": 1,
"clockRate": 48000,
"mimeType": "audio/telephone-event",
"payloadType": 110
}
]

peerConnection.getReceivers()[1].getParameters().codecs ->
[
{
"clockRate": 90000,
"mimeType": "video/VP8",
"payloadType": 96
}
]


Thanks in advance
R

Philipp Hancke

unread,
Aug 10, 2023, 5:42:39 AM8/10/23
to discuss...@googlegroups.com
These are the codecs that are negotiated. Only one of them can be used at a time so .encodings will be an array with a length of 1.

--
This list falls under the WebRTC Code of Conduct - https://webrtc.org/support/code-of-conduct.
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/a6f1c447-6121-4eb8-bcbe-ddcf200dc7c8n%40googlegroups.com.

Abhinav Ananth

unread,
Aug 10, 2023, 5:49:32 AM8/10/23
to discuss...@googlegroups.com
Oh I see, so even this shows the list of codecs negotiated? How can I know which codec is currently in use?

Regards

You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/UBRXVmmEVX8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CADxkKiLJ77DhvtaV71R092Gs6m_bAVQY9OTDqbb0bL-exVu%2BEQ%40mail.gmail.com.

Philipp Hancke

unread,
Aug 11, 2023, 2:04:59 AM8/11/23
to discuss...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages