I’ve setup my router to support VP8 and VP9 among others. Here’s the config:
mediaCodecs:
[
{
kind: 'audio',
mimeType: 'audio/opus',
clockRate: 48000,
channels: 2
},
{
kind : 'video',
mimeType : 'video/VP9',
clockRate : 90000,
parameters:
{
'x-google-start-bitrate': 1000
}
},
{
kind: 'video',
mimeType: 'video/VP8',
clockRate: 90000,
parameters:
{
'x-google-start-bitrate': 1000
}
},
{
kind : 'video',
mimeType : 'video/H264',
clockRate : 90000,
parameters :
{
'packetization-mode' : 1,
'level-asymmetry-allowed' : 1
}
},
{
kind : 'video',
mimeType : 'video/H264',
clockRate : 90000,
parameters :
{
'packetization-mode' : 0,
'level-asymmetry-allowed' : 1
}
},
{
kind : 'video',
mimeType : 'video/H265',
clockRate : 90000,
parameters :
{
'packetization-mode' : 1,
'level-asymmetry-allowed' : 1
}
},
{
kind : 'video',
mimeType : 'video/H265',
clockRate : 90000,
parameters :
{
'packetization-mode' : 0,
'level-asymmetry-allowed' : 1
}
}
]
My Chrome producer and consumer work fine and at first glance C++ client capabilities look same to me (see both their device.rtpCapabilities below).
However, for C++ client mediasoupRouter.canConsume(...)
returns false, and transport.produce(...)
throws an UnsupportedError exception saying:
UnsupportedError: unsupported codec [mimeType:video/VP9, payloadType:98]
at Object.getProducerRtpParametersMapping (/Users/peetonn/Documents/Work/videocore-media-server/node_modules/mediasoup/lib/ortc.js:503:19)
at WebRtcTransport.produce (/Users/peetonn/Documents/Work/videocore-media-server/node_modules/mediasoup/lib/Transport.js:243:33)
at Socket.<anonymous> (/Users/peetonn/Documents/Work/videocore-media-server/server.js:151:64)
at Socket.emit (node:events:379:20)
at /Users/peetonn/Documents/Work/videocore-media-server/node_modules/socket.io/lib/socket.js:528:12
at processTicksAndRejections (node:internal/process/task_queues:76:11)
What am I missing? Why would router say the codec is not supported when it’s obviously supported (checked Chrome-to-Chrome VP9 streaming)?
Chrome client device.rtpCapabilities
:
"rtpCapabilities": {
"codecs": [
{
"mimeType": "audio/opus",
"kind": "audio",
"preferredPayloadType": 100,
"clockRate": 48000,
"channels": 2,
"parameters": {
"minptime": 10,
"useinbandfec": 1
},
"rtcpFeedback": [
{
"type": "transport-cc",
"parameter": ""
}
]
},
{
"mimeType": "video/VP9",
"kind": "video",
"preferredPayloadType": 101,
"clockRate": 90000,
"parameters": {
"profile-id": 0
},
"rtcpFeedback": [
{
"type": "goog-remb",
"parameter": ""
},
{
"type": "transport-cc",
"parameter": ""
},
{
"type": "ccm",
"parameter": "fir"
},
{
"type": "nack",
"parameter": ""
},
{
"type": "nack",
"parameter": "pli"
}
]
},
{
"mimeType": "video/rtx",
"kind": "video",
"preferredPayloadType": 102,
"clockRate": 90000,
"parameters": {
"apt": 101
},
"rtcpFeedback": []
},
{
"mimeType": "video/VP8",
"kind": "video",
"preferredPayloadType": 103,
"clockRate": 90000,
"parameters": {},
"rtcpFeedback": [
{
"type": "goog-remb",
"parameter": ""
},
{
"type": "transport-cc",
"parameter": ""
},
{
"type": "ccm",
"parameter": "fir"
},
{
"type": "nack",
"parameter": ""
},
{
"type": "nack",
"parameter": "pli"
}
]
},
{
"mimeType": "video/rtx",
"kind": "video",
"preferredPayloadType": 104,
"clockRate": 90000,
"parameters": {
"apt": 103
},
"rtcpFeedback": []
},
{
"mimeType": "video/H264",
"kind": "video",
"preferredPayloadType": 105,
"clockRate": 90000,
"parameters": {
"level-asymmetry-allowed": 1,
"packetization-mode": 1,
"profile-level-id": "42e01f"
},
"rtcpFeedback": [
{
"type": "goog-remb",
"parameter": ""
},
{
"type": "transport-cc",
"parameter": ""
},
{
"type": "ccm",
"parameter": "fir"
},
{
"type": "nack",
"parameter": ""
},
{
"type": "nack",
"parameter": "pli"
}
]
},
{
"mimeType": "video/rtx",
"kind": "video",
"preferredPayloadType": 106,
"clockRate": 90000,
"parameters": {
"apt": 105
},
"rtcpFeedback": []
},
{
"mimeType": "video/H264",
"kind": "video",
"preferredPayloadType": 107,
"clockRate": 90000,
"parameters": {
"level-asymmetry-allowed": 1,
"packetization-mode": 0,
"profile-level-id": "42e01f"
},
"rtcpFeedback": [
{
"type": "goog-remb",
"parameter": ""
},
{
"type": "transport-cc",
"parameter": ""
},
{
"type": "ccm",
"parameter": "fir"
},
{
"type": "nack",
"parameter": ""
},
{
"type": "nack",
"parameter": "pli"
}
]
},
{
"mimeType": "video/rtx",
"kind": "video",
"preferredPayloadType": 108,
"clockRate": 90000,
"parameters": {
"apt": 107
},
"rtcpFeedback": []
}
],
"headerExtensions": [
{
"kind": "audio",
"uri": "urn:ietf:params:rtp-hdrext:sdes:mid",
"preferredId": 1,
"preferredEncrypt": false,
"direction": "sendrecv"
},
{
"kind": "video",
"uri": "urn:ietf:params:rtp-hdrext:sdes:mid",
"preferredId": 1,
"preferredEncrypt": false,
"direction": "sendrecv"
},
{
"kind": "audio",
"uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time",
"preferredId": 4,
"preferredEncrypt": false,
"direction": "sendrecv"
},
{
"kind": "video",
"uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time",
"preferredId": 4,
"preferredEncrypt": false,
"direction": "sendrecv"
},
{
"kind": "video",
"uri": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01",
"preferredId": 5,
"preferredEncrypt": false,
"direction": "sendrecv"
},
{
"kind": "audio",
"uri": "urn:ietf:params:rtp-hdrext:ssrc-audio-level",
"preferredId": 10,
"preferredEncrypt": false,
"direction": "sendrecv"
},
{
"kind": "video",
"uri": "urn:3gpp:video-orientation",
"preferredId": 11,
"preferredEncrypt": false,
"direction": "sendrecv"
},
{
"kind": "video",
"uri": "urn:ietf:params:rtp-hdrext:toffset",
"preferredId": 12,
"preferredEncrypt": false,
"direction": "sendrecv"
}
]
}
C++ client device.GetRtpCapabilities()
:
"rtpCapabilities": {
"codecs": [
{
"channels": 2,
"clockRate": 48000,
"kind": "audio",
"mimeType": "audio/opus",
"parameters": {
"minptime": 10,
"useinbandfec": 1
},
"preferredPayloadType": 100,
"rtcpFeedback": [
{
"parameter": "",
"type": "transport-cc"
}
]
},
{
"clockRate": 90000,
"kind": "video",
"mimeType": "video/VP9",
"parameters": {
"profile-id": "0"
},
"preferredPayloadType": 101,
"rtcpFeedback": [
{
"parameter": "",
"type": "goog-remb"
},
{
"parameter": "",
"type": "transport-cc"
},
{
"parameter": "fir",
"type": "ccm"
},
{
"parameter": "",
"type": "nack"
},
{
"parameter": "pli",
"type": "nack"
}
]
},
{
"clockRate": 90000,
"kind": "video",
"mimeType": "video/rtx",
"parameters": {
"apt": 101
},
"preferredPayloadType": 102,
"rtcpFeedback": []
},
{
"clockRate": 90000,
"kind": "video",
"mimeType": "video/VP8",
"parameters": {},
"preferredPayloadType": 103,
"rtcpFeedback": [
{
"parameter": "",
"type": "goog-remb"
},
{
"parameter": "",
"type": "transport-cc"
},
{
"parameter": "fir",
"type": "ccm"
},
{
"parameter": "",
"type": "nack"
},
{
"parameter": "pli",
"type": "nack"
}
]
},
{
"clockRate": 90000,
"kind": "video",
"mimeType": "video/rtx",
"parameters": {
"apt": 103
},
"preferredPayloadType": 104,
"rtcpFeedback": []
}
],
"headerExtensions": [
{
"direction": "sendrecv",
"kind": "audio",
"preferredEncrypt": false,
"preferredId": 1,
"uri": "urn:ietf:params:rtp-hdrext:sdes:mid"
},
{
"direction": "sendrecv",
"kind": "video",
"preferredEncrypt": false,
"preferredId": 1,
"uri": "urn:ietf:params:rtp-hdrext:sdes:mid"
},
{
"direction": "sendrecv",
"kind": "audio",
"preferredEncrypt": false,
"preferredId": 4,
"uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"
},
{
"direction": "sendrecv",
"kind": "video",
"preferredEncrypt": false,
"preferredId": 4,
"uri": "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"
},
{
"direction": "sendrecv",
"kind": "video",
"preferredEncrypt": false,
"preferredId": 5,
"uri": "http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"
},
{
"direction": "sendrecv",
"kind": "video",
"preferredEncrypt": false,
"preferredId": 6,
"uri": "http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07"
},
{
"direction": "sendrecv",
"kind": "audio",
"preferredEncrypt": false,
"preferredId": 10,
"uri": "urn:ietf:params:rtp-hdrext:ssrc-audio-level"
},
{
"direction": "sendrecv",
"kind": "video",
"preferredEncrypt": false,
"preferredId": 11,
"uri": "urn:3gpp:video-orientation"
},
{
"direction": "sendrecv",
"kind": "video",
"preferredEncrypt": false,
"preferredId": 12,
"uri": "urn:ietf:params:rtp-hdrext:toffset"
}
]
}