Simulcast in iOS WebRTC is sending only 1 track instead of 3
We are trying to enable Simulcast on our iOS application. Before connecting to room, we enabled simulcast, and got the following in offer payload.
a=rid:q send
a=rid:h send
a=rid:f send
a=simulcast:send q;h;f
The payload shows that 3 tracks are added in offer payload. And after that, we observed the WebRTC stat report to see the changes. However, only one frame was encoded with rid = q
and sent. rid = f;
and rid = h;
are not encoded and sending framesEncoded=0
. Here’s the log of that.
id = RTCOutboundRTPVideoStream_2851660940, type = outbound-rtp, timestamp = 1664261768776873, values = {
bytesSent = 176170;
codecId = "RTCCodec_0_Outbound_98";
encoderImplementation = VideoToolbox;
firCount = 0;
frameHeight = 1920;
frameWidth = 1080;
framesEncoded = 39;
framesPerSecond = 30;
framesSent = 39;
headerBytesSent = 13368;
hugeFramesSent = 24;
keyFramesEncoded = 2;
kind = video;
mediaSourceId = "RTCVideoSource_1";
mediaType = video;
nackCount = 0;
packetsSent = 209;
pliCount = 0;
qpSum = 1546;
qualityLimitationDurations = {
bandwidth = "0.54";
cpu = 0;
none = "1.014";
other = 0;
};
qualityLimitationReason = none;
qualityLimitationResolutionChanges = 1;
remoteId = "RTCRemoteInboundRtpVideoStream_2851660940";
retransmittedBytesSent = 0;
retransmittedPacketsSent = 0;
rid = q;
ssrc = 2851660940;
totalEncodeTime = "0.574";
totalEncodedBytesTarget = 0;
totalPacketSendDelay = "11.37";
trackId = "RTCMediaStreamTrack_sender_1";
transportId = "RTCTransport_0_1";
}
id = RTCOutboundRTPVideoStream_1878842665, type = outbound-rtp, timestamp = 1664261768776873, values = {
bytesSent = 0;
codecId = "RTCCodec_0_Outbound_98";
encoderImplementation = VideoToolbox;
firCount = 0;
framesEncoded = 0;
framesSent = 0;
headerBytesSent = 0;
hugeFramesSent = 0;
keyFramesEncoded = 0;
kind = video;
mediaSourceId = "RTCVideoSource_1";
mediaType = video;
nackCount = 0;
packetsSent = 0;
pliCount = 0;
qualityLimitationDurations = {
bandwidth = "0.54";
cpu = 0;
none = "1.014";
other = 0;
};
qualityLimitationReason = none;
qualityLimitationResolutionChanges = 1;
retransmittedBytesSent = 0;
retransmittedPacketsSent = 0;
rid = f;
ssrc = 1878842665;
totalEncodeTime = 0;
totalEncodedBytesTarget = 0;
totalPacketSendDelay = 0;
trackId = "RTCMediaStreamTrack_sender_1";
transportId = "RTCTransport_0_1";
}
id = RTCOutboundRTPVideoStream_755503164, type = outbound-rtp, timestamp = 1664261768776873, values = {
bytesSent = 0;
codecId = "RTCCodec_0_Outbound_98";
encoderImplementation = VideoToolbox;
firCount = 0;
framesEncoded = 0;
framesSent = 0;
headerBytesSent = 0;
hugeFramesSent = 0;
keyFramesEncoded = 0;
kind = video;
mediaSourceId = "RTCVideoSource_1";
mediaType = video;
nackCount = 0;
packetsSent = 0;
pliCount = 0;
qualityLimitationDurations = {
bandwidth = "0.54";
cpu = 0;
none = "1.014";
other = 0;
};
qualityLimitationReason = none;
qualityLimitationResolutionChanges = 1;
retransmittedBytesSent = 0;
retransmittedPacketsSent = 0;
rid = h;
ssrc = 755503164;
totalEncodeTime = 0;
totalEncodedBytesTarget = 0;
totalPacketSendDelay = 0;
trackId = "RTCMediaStreamTrack_sender_1";
transportId = "RTCTransport_0_1";
}
We are trying to solve this, but is not getting nowhere. We can’t seem to figure out why rid = f;
and rid = h;
is sending nothing. Any hint, help or any pointers are appreciated. Thanks.
Read more here: Source link