Hi, I am following the article Simulcast and Janus: what’s new? (and where’s my SSRC?) | Meetecho Blog to create a simulcast stream with 3 different qualities setting it on the transceiver side. The videotrack is h264. The sdp is generated correctly and everything looks good.
v=0
no=- 3383397139837300255 2 IN IP4 127.0.0.1
ns=-
nt=0 0
na=group:BUNDLE 0 1
na=extmap-allow-mixed
na=msid-semantic: WMS e23ac07d-a5e6-4c2b-a93e-c7ab09c9ffe2
nm=video 9 UDP/TLS/RTP/SAVPF 123 122 121 120
nc=IN IP4 0.0.0.0
na=rtcp:9 IN IP4 0.0.0.0
na=ice-ufrag:Y1Pj
na=ice-pwd:w0W80QYe7Q+ZdOxPw4pyaXJs
na=ice-options:trickle
na=fingerprint:sha-256 38:0C:1B:60:89:94:A4:2D:E9:28:41:5C:A0:99:72:A4:2C:79:36:34:E2:73:4E:9E:C4:93:5A:14:54:F2:61:08
na=setup:actpass
na=mid:0
na=extmap:1 urn:ietf:params:rtp-hdrext:toffset
na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
na=extmap:3 urn:3gpp:video-orientation
na=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
na=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
na=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
na=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
na=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
na=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
na=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
na=sendonly
na=msid:e23ac07d-a5e6-4c2b-a93e-c7ab09c9ffe2 9ead9e35-677b-4a09-a325-9a96cfcd9f39
na=rtcp-mux
na=rtcp-rsize
na=rtpmap:123 H264/90000
na=rtcp-fb:123 goog-remb
na=rtcp-fb:123 transport-cc
na=rtcp-fb:123 ccm fir
na=rtcp-fb:123 nack
na=rtcp-fb:123 nack pli
na=fmtp:123 implementation_name=NvCodec;level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e033
na=rtpmap:122 H264/90000
na=rtcp-fb:122 goog-remb
na=rtcp-fb:122 transport-cc
na=rtcp-fb:122 ccm fir
na=rtcp-fb:122 nack
na=rtcp-fb:122 nack pli
na=fmtp:122 implementation_name=NvCodec;level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=420033
na=rtpmap:121 H264/90000
na=rtcp-fb:121 goog-remb
na=rtcp-fb:121 transport-cc
na=rtcp-fb:121 ccm fir
na=rtcp-fb:121 nack
na=rtcp-fb:121 nack pli
na=fmtp:121 implementation_name=NvCodec;level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640033
na=rtpmap:120 H264/90000
na=rtcp-fb:120 goog-remb
na=rtcp-fb:120 transport-cc
na=rtcp-fb:120 ccm fir
na=rtcp-fb:120 nack
na=rtcp-fb:120 nack pli
na=fmtp:120 implementation_name=NvCodec;level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d0033
na=rid:h send
na=rid:m send
na=rid:l send
na=simulcast:send h;m;l
nm=audio 9 UDP/TLS/RTP/SAVPF 96 97 98 99 102 103 104 9 0 8 100 101 107 108 109 114 110 112 113 126
nc=IN IP4 0.0.0.0
na=rtcp:9 IN IP4 0.0.0.0
na=ice-ufrag:Y1Pj
na=ice-pwd:w0W80QYe7Q+ZdOxPw4pyaXJs
na=ice-options:trickle
na=fingerprint:sha-256 38:0C:1B:60:89:94:A4:2D:E9:28:41:5C:A0:99:72:A4:2C:79:36:34:E2:73:4E:9E:C4:93:5A:14:54:F2:61:08
na=setup:actpass
na=mid:1
na=extmap:14 urn:ietf:params:rtp-hdrext:ssrc-audio-level
na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
na=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
na=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
na=sendrecv
na=msid:e23ac07d-a5e6-4c2b-a93e-c7ab09c9ffe2 82071518-d86e-40e0-8bac-08fe5d96df7b
na=rtcp-mux
na=rtpmap:96 opus/48000/2
na=rtcp-fb:96 transport-cc
na=fmtp:96 minptime=10;sprop-stereo=1;stereo=1;useinbandfec=1
na=rtpmap:97 red/48000/2
na=fmtp:97 96/96
na=rtpmap:98 multiopus/48000/6
na=fmtp:98 channel_mapping=0,4,1,2,3,5;coupled_streams=2;minptime=10;num_streams=4;useinbandfec=1
na=rtpmap:99 multiopus/48000/8
na=fmtp:99 channel_mapping=0,6,1,2,3,4,5,7;coupled_streams=3;minptime=10;num_streams=5;useinbandfec=1
na=rtpmap:102 ILBC/8000
na=rtpmap:103 ISAC/16000
na=rtpmap:104 ISAC/32000
na=rtpmap:9 G722/8000
na=rtpmap:0 PCMU/8000
na=rtpmap:8 PCMA/8000
na=rtpmap:100 L16/8000
na=rtpmap:101 L16/16000
na=rtpmap:107 L16/32000
na=rtpmap:108 L16/8000/2
na=rtpmap:109 L16/16000/2
na=rtpmap:114 L16/32000/2
na=rtpmap:110 telephone-event/48000
na=rtpmap:112 telephone-event/32000
na=rtpmap:113 telephone-event/16000
na=rtpmap:126 telephone-event/8000
na=ssrc:1720815888 cname:UViF8F+6ZRrj/g6V
na=ssrc:1720815888 msid:e23ac07d-a5e6-4c2b-a93e-c7ab09c9ffe2 82071518-d86e-40e0-8bac-08fe5d96df7b
But the problem is on the client, when I consume the stream, the highest quality is played by default, as you can see on substream-target after attaching.
"plugin": "janus.plugin.videoroom",
"data": {
"videoroom": "attached",
"room": 1234,
"id": 113450249,
"warning": "deprecated_api",
"display": "unity",
"streams": [
{
"type": "video",
"active": true,
"mindex": 0,
"mid": "0",
"ready": false,
"send": true,
"feed_id": 113450249,
"feed_display": "unity",
"feed_mid": "0",
"codec": "h264",
"h264-profile": "42e033",
"simulcast": {
"substream": -1,
"substream-target": 2,
"temporal-layer": -1,
"temporal-layer-target": 2
}
},
{
"type": "audio",
"active": true,
"mindex": 1,
"mid": "1",
"ready": false,
"send": true,
"feed_id": 113450249,
"feed_display": "unity",
"feed_mid": "1",
"codec": "opus"
}
]
}
},
Then I receive an event that the substream has been set correctly to 2.
[
{
"janus": "event",
"session_id": 618328994457738,
"sender": 3828716482194333,
"plugindata": {
"plugin": "janus.plugin.videoroom",
"data": {
"videoroom": "event",
"room": 1234,
"mid": "0",
"substream": 2
}
}
}
]
I can see the video perfectly. Then, I try to change the substream following the videoroom API:
this.remoteVideoRoomHandles[remoteFeedId].send({
message: {
request: 'configure',
substream: substream,
},
});
The request is sent:
And janus responses with:
{
"janus": "ack",
"session_id": 2375912949686871,
"transaction": "FgIRUykGTLPK"
}
But the problem is that after doing this, nothing happens. I am not able to change the substream. I’ve also tried to send the configure to the videoroom handle, instead of the remoteFeedHandle, and the response is:
configured: "ok"
room: 1234
videoroom: "event"
But again, nothing happens. I still see the highest quality substream. Of course, the 3 substreams are clearly distinguishable, they are set to (it’s in C#):
RTCRtpEncodingParameters parameterH = new RTCRtpEncodingParameters();
parameterH.maxBitrate = ConvertToBits(10.5f);
parameterH.scaleResolutionDownBy = 1;
parameterH.maxFramerate = 60;
parameterH.active = true;
parameterH.rid = "h";
RTCRtpEncodingParameters parameterM = new RTCRtpEncodingParameters();
parameterM.maxBitrate = ConvertToBits(4.5f);
parameterM.scaleResolutionDownBy = 1;
parameterM.active = true;
parameterM.maxFramerate = 15;
parameterM.rid = "m";
RTCRtpEncodingParameters parameterL = new RTCRtpEncodingParameters();
parameterL.maxBitrate = ConvertToBits(0.5f);
parameterL.scaleResolutionDownBy = 1;
parameterL.active = true;
parameterL.maxFramerate = 1;
parameterL.rid = "l";
What am I doing wrong?
Thank for your help.
Edit: The janus version I am using is 1.1.0