Bug 260898

Summary: REGRESSSION (iOS 16.6 - iOS 17 Beta 8): Calling getImageData after drawing a getUserMedia video to canvas becomes as slow as 0.5fps
Product: WebKit Reporter: Shawn Lee <shawnlee>
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: eric.carlson, jer.noble, webkit-bug-importer, wenson_hsieh, wilander, youennf
Priority: P2 Keywords: InRadar
Version: Safari 17   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
screencast
none
screen cast on 16.6 ipad pro 11 inch 2018 none

Description Shawn Lee 2023-08-30 02:36:50 PDT
Created attachment 467488 [details]
screencast

Demo : https://t6mcnq.csb.app/

Tested on iPhone 13, the demo requests a video of size 4032x3024 and continuously calls drawImage/getImageData.

It is used to achieve a minimum of 10 frames per second (fps).
However, it is currently only achieving a slow rate of 0.5 fps.
Ideally, I would expect it to achieve 30 fps.
Comment 1 Shawn Lee 2023-08-30 04:56:14 PDT
Created attachment 467490 [details]
screen cast on 16.6 ipad pro 11 inch 2018

Tested on iOS 16.6 with iPad pro 2018 11 inch.
It takes only 20 ms per frame.

So there is 100x slow down on iOS 17 beta 8
Comment 2 Shawn Lee 2023-08-30 05:50:50 PDT
I believe the decrease in speed could be attributed to the injection of canvas noise.

I conducted tests using the front camera of a MacBook with lower resolution on Safari Technology Preview 177. When advanced tracking protection is enabled, each frame takes approximately 600ms. However, when it is disabled, the frame processing time reduces to 10ms.

I am uncertain whether this slowdown is intentional. Personally, I consider it unwise to significantly compromise the user experience when advanced tracking protection is enabled. Users may not be aware of the issue and could mistakenly assume that our website is broken.
Comment 3 Radar WebKit Bug Importer 2023-08-30 08:51:23 PDT
<rdar://problem/114703880>
Comment 4 Alexey Proskuryakov 2023-11-03 15:50:42 PDT
This should be fixed with the change made in bug 263129.

*** This bug has been marked as a duplicate of bug 263129 ***