Bug 220362 - Muted video track stops sending packets if receive RTCP PLI request
Summary: Muted video track stops sending packets if receive RTCP PLI request
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 14
Hardware: Unspecified macOS 11
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-01-06 06:13 PST by Igor
Modified: 2021-05-17 02:10 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor 2021-01-06 06:13:32 PST
Browser version: Safari 14.0.2 (16610.3.7.1.9)

Issue: muted video track stops to send any video packet after receiving RTCP PLI message

How to reproduce: 
1. Safari: open https://demo.flashphoner.com/client2/examples/demo/streaming/media_devices_manager/media_device_manager.html
2. Click Connect, then Publish
3. See Pli Count
4. Switch Video Mute to On, wait for Pli Count increase, then unmute video by switching to Off
5. After getting PLI in muted state Safari will stop video packets.
Comment 1 youenn fablet 2021-01-06 06:21:15 PST
Thanks for the report.

I tried the repro steps on Safari Tech Preview and was not able to reproduce.
Can you try it on your side?
Comment 2 Igor 2021-01-06 07:57:15 PST
Reproduced with latest Safari Tech Preview.

I forgot to say that you need to change resolution to 640x360 instead of default 640x480
Comment 3 Radar WebKit Bug Importer 2021-01-06 08:06:19 PST
<rdar://problem/72851967>
Comment 4 youenn fablet 2021-01-06 08:20:32 PST
I am still seeing "Packets Sent" increasing after unmuting.
When muting, the number of packets increases slowly as expected.
When unmuting, the number of packets increases steadily.
Comment 5 Igor 2021-01-07 21:24:19 PST
(In reply to youenn fablet from comment #4)
> I am still seeing "Packets Sent" increasing after unmuting.
> When muting, the number of packets increases slowly as expected.
> When unmuting, the number of packets increases steadily.

I recorded screen cast with the issue, you can check it here: https://filebin.net/dodb62j775ou92t1

Did you wait for PLI count increasing before unmuting the video?
Comment 6 youenn fablet 2021-01-08 05:50:27 PST
> I recorded screen cast with the issue, you can check it here:
> https://filebin.net/dodb62j775ou92t1

That is interesting.
In your case, when you mute the track, the number of packets sent gets frozen, the bitrate is down to zero. It is as if the sender is fully stopped or something like sender.replaceTrack(null);

On my side, I continue to see a small bitrate, packets sent increase...
This is due to the fact that a muted track will trigger sending one black frame per second.

Can you verify this?
Alternatively, you can enable web inspector, set WebRTC logging to verbose and look at WebRTC logging (in system console or web inspector console).
Comment 7 Igor 2021-01-11 00:17:10 PST
(In reply to youenn fablet from comment #6)
> Can you verify this?
> Alternatively, you can enable web inspector, set WebRTC logging to verbose
> and look at WebRTC logging (in system console or web inspector console).

Here is another screen cast, https://filebin.net/izr4g99jp4ry9zfd

I increased PLI interval up to 20 seconds. From video you can see that after muting video track still sends packets before getting the new PLI request.

I checked media track state, it has only one changed property - 'enabled = false', also checked RTCRtpSender with getSenders() - there are two senders before and after muting - sender with audio track and sender with video track. 

WebRTC logging shows that webrtc stack sends black frame, but no packets on outbound connection.
Comment 8 Igor 2021-01-18 21:39:16 PST
Any updates with this bug?
Comment 9 youenn fablet 2021-05-17 02:10:03 PDT
@Igor, this is a video encoder issue.
I passed it down to the corresponding team which fixed it.