[Webkit-unassigned] [Bug 236604] New: Unable to reliably grab video frame from Blob immediately after loading

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 14 12:41:02 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=236604

            Bug ID: 236604
           Summary: Unable to reliably grab video frame from Blob
                    immediately after loading
           Product: WebKit
           Version: Safari 15
          Hardware: iPhone / iPad
                OS: iOS 15
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: teodor.atroshenko at gmail.com

Problem: Generating video preview/thumbnail locally (on iOS device).

Approach: File is loaded (via URL.createObjectURL) into <video> element, the time is set to middle of the file, video frame is drawn onto canvas, canvas contents are exported as JPEG.

All browsers, except Safari, either make video frame available before firing events, or wait until a frame is available when a call is made to capture it.

Reproduction: https://codepen.io/thexeos/pen/GROEYrN
Open on iPhone (not tested on macOS) and select video file. You are expecting to see 3 video stills. If only one is shown - it is broken.
Now, comment out the resolve(video) in video.onseeked handler and use setTimeout version - it works "realiably" (larger file, older device, multiple tabs open in Safari all affect the minimum delay needed).

seeked event is used in codepen, but waiting until after dataloaded, canplay, canplaythrough, or any combination of those followed by or preceding seeked all lead to flaky results. Most often it does not work. On rare occasions I was able to grab a frame successfully within 16ms after last event in a chain, but usually the delay is much larger. The video used when testing was less than 1 minute long and about 15 megabytes in size.

Maybe related: https://chromium.googlesource.com/chromium/src/+/f2a8353e592bc8ef5827a378adc919eb1075f5a3/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp#367

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220214/ad99d9cf/attachment.htm>


More information about the webkit-unassigned mailing list