WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
257803
Terrible video quality when using TransformStream with Simulcast
https://bugs.webkit.org/show_bug.cgi?id=257803
Summary
Terrible video quality when using TransformStream with Simulcast
pminchev
Reported
2023-06-07 07:59:16 PDT
Created
attachment 466619
[details]
The crazy jitter value coming from the Peer Connection Stats 1. Have a WebRTC app which publishes/receives simulcast streams (through a SFU media server). 2. Have a TransformStream in a worker which just passes unmodified the stream (RTCRtpScriptTransform): const transformStream = new TransformStream({ transform: async (chunk, controller) => { controller.enqueue(chunk); //Unmodified chunk } }) 3. Observe the received video quality is pixelated and terrible. 4. Observe only the L layer 320x180 remains with a very high bitrate and suddenly jitter value in PeerConnection stats becomes HUGE: 7737 seconds - 2 hours which is practically an impossible value. Attaching screenshots. If simulcast is not used, then video quality is fine, but the moment simulcast and a TransformStream is used, the quality goes bad and jitter of 2 hours appears. Jitsi (a videoconference provider) also experiences this issue on Safari ->
https://community.jitsi.org/t/e2ee-on-ios-safari-with-enableencodedtransformsupport/114517/9
So it seems a widespread issue under Safari. Under Chrome on MacOS everything is fine (with the same SFU media server, simulcast and Insertable Streams). So that seems to confirm it is a Safari/Webkit issue.
Attachments
The crazy jitter value coming from the Peer Connection Stats
(1.04 MB, image/png)
2023-06-07 07:59 PDT
,
pminchev
no flags
Details
WebRTC logs from Safari
(58.51 KB, text/plain)
2023-06-27 09:37 PDT
,
pminchev
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2023-06-07 08:04:30 PDT
<
rdar://problem/110395571
>
youenn fablet
Comment 2
2023-06-27 02:08:34 PDT
@pminchev, do you have a test site where the issue can be reproduced? What WebRTC logs do you get on the sending side?
pminchev
Comment 3
2023-06-27 09:37:06 PDT
Created
attachment 466832
[details]
WebRTC logs from Safari
pminchev
Comment 4
2023-06-27 09:37:31 PDT
(In reply to youenn fablet from
comment #2
)
> @pminchev, do you have a test site where the issue can be reproduced? > What WebRTC logs do you get on the sending side?
Yes,
https://demos.digitalsamba.com/safari_simulcast.html
Just enter some random name and click join. You need at least 2 people from Safari in the room, since the local video preview doesn't go through the media servers, only the subscribed videos. Of course you can just open 2 browser tabs if you don't want to ask a second person to join. A heavy pixelation is soon observed for the consumed streams. It fixes itself for a few seconds, then it appears again - kind of random. Also as I mentioned in the original description - the M simulcast layer often disappears and L layer with a > 7000 seconds jitter appears. Note this demo uses end-to-end encryption, but even without it, we experience the same issues - the moment TransformStream is used with simulcast. I am also attaching some WebRTC logs, hope they are helpful.
pminchev
Comment 5
2023-10-02 01:17:28 PDT
@youenn fablet - Did you manage to reproduce? Do you need something more as a report? It has been 3 months, and we still cannot support E2EE under Safari because of the issue. Thanks in advance!
youenn fablet
Comment 6
2023-10-02 09:14:13 PDT
Thanks for the ping. I had a try at
https://demos.digitalsamba.com/safari_simulcast.html
and was able to reproduce the bad quality. Via web inspector, I set the transformers to null and it did not change the quality overall. I saw repeated packet loss though on sending and receiving side, I need to retry on a different network with ethernet probably.
pminchev
Comment 7
2023-10-02 09:52:00 PDT
(In reply to youenn fablet from
comment #6
)
> Thanks for the ping. > I had a try at
https://demos.digitalsamba.com/safari_simulcast.html
and was > able to reproduce the bad quality. > > Via web inspector, I set the transformers to null and it did not change the > quality overall. > I saw repeated packet loss though on sending and receiving side, I need to > retry on a different network with ethernet probably.
Thanks for checking - you can compare to Firefox (quality there is good). For Firefox & Safari we use the same RTCRtpScriptTransform API, but under Safari receiving quality is bad.
youenn fablet
Comment 8
2023-10-05 01:18:48 PDT
OK, I was able to reproduce and there is indeed an issue as the transform triggers mixing the simulcast streams in one ssrc. I'll fix this shortly
youenn fablet
Comment 9
2023-10-05 01:55:02 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/18681
EWS
Comment 10
2023-10-05 06:14:12 PDT
Committed
268912@main
(1fc26a73bcc7): <
https://commits.webkit.org/268912@main
> Reviewed commits have been landed. Closing PR #18681 and removing active labels.
pminchev
Comment 11
2023-10-05 08:56:15 PDT
(In reply to youenn fablet from
comment #9
)
> Pull request:
https://github.com/WebKit/WebKit/pull/18681
Thank you very much for the PR! I see it is merged to webkit master. Do you know more about when it would become part of Safari? Maybe you know more how does Safari patches and release cycle work when there are webkit fixes being done.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug