artvan
(art vanderhoff)
February 2, 2021, 11:59pm
1
could someone help me with a basic example. I am trying to understand the transport.consume() api
according to the docs https://mediasoup.org/documentation/v3/mediasoup/rtp-parameters-and-capabilities/#RtpCapabilities these should be passed with a create broadcaster request, but I can’t find an example of what the format should be.
following the link https://mediasoup.org/documentation/v3/mediasoup/rtp-parameters-and-capabilities/#RtpCodecCapability I am assuming I need an array that reflects
codecs: {
{ channels: 2
clockRate: 48000
kind: "audio"
mimeType: "audio/opus"
},
{ clockRate: 90000,
kind: "video",
mimeType: "video/VP8",
parameters: {
x-google-start-bitrate: 1000 },
preferredPayloadType: 101,
rtcpFeedback: {
{type: "nack", parameter: ""},
{type: "nack", parameter: "pli"},
{type: "ccm", parameter: "fir"},
{type: "goog-remb", parameter: ""},
{type: "transport-cc", parameter: ""} }
}
}
headerExtensions: {...} //etc
I am trying to get a gstreamer app as a consumer for the gstreamer demo producer.
Can someone provide a basic example of how you format such an array.
ibc
(Iñaki Baz Castillo)
February 3, 2021, 12:09am
2
A good example of those rtpCapabilities
is mediasoup router.rtpCapabilities
(documented in the API section).
Also: mediasoup :: Communication Between Client and Server
artvan
(art vanderhoff)
February 3, 2021, 2:27pm
3
for those needing a template that works for me, feel free to suggest corrections or omissions.
rtpCapabilities:="{
\"headerExtensions\" :
[
{
\"kind\" : \"video\",
\"uri\" : \"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\",
\"preferredId\" : 4,
\"preferredEncrypt\" : false
},
{
\"kind\" : \"audio\",
\"uri\" : \"urn:ietf:params:rtp-hdrext:ssrc-audio-level\",
\"preferredId\" : 8,
\"preferredEncrypt\" : false
},
{
\"kind\" : \"video\",
\"uri\" : \"urn:3gpp:video-orientation\",
\"preferredId\" : 9,
\"preferredEncrypt\" : false
},
{
\"kind\" : \"video\",
\"uri\" : \"urn:ietf:params:rtp-hdrext:toffset\",
\"preferredId\" : 10,
\"preferredEncrypt\" : false
}
],
\"codecs\": [
{
\"kind\": \"audio\",
\"mimeType\": \"audio/opus\",
\"payloadType\":\"${AUDIO_PT}\",
\"clockRate\":48000
},
{
\"rtcpFeedback\": [
{\"type\": \"nack\", \"parameter\": \"\"},
{\"type\": \"nack\", \"parameter\": \"pli\"},
{\"type\": \"ccm\", \"parameter\": \"fir\"},
{\"type\": \"goog-remb\", \"parameter\": \"\"},
{\"type\": \"transport-cc\", \"parameter\": \"\"}
],
\"clockRate\":90000,
\"payloadType\":\"${VIDEO_PT}\",
\"kind\": \"video\",
\"mimeType\": \"video/vp8\"
}
]
}"
ibc
(Iñaki Baz Castillo)
February 3, 2021, 2:44pm
4
Actually rtpCapabilities in consume() must represent the real RTP capabilities/features supported by the consuming endpoint. Does it?
For example: it doesn’t make any sense that you announce REMB or transport-cc support if your endpoint does not support them (mediasoup server will assume that it does and will behave different).
artvan
(art vanderhoff)
February 3, 2021, 3:44pm
5
yes it does, it is just for a template example that passes the validation test