Bug 216076

Summary: MediaRecorder timeslice parameter causing internal error on longer videos
Product: WebKit Reporter: Paul <paconlin>
Component: WebRTCAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, eric.carlson, ggaren, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac   
OS: macOS 10.15   
URL: https://codesandbox.io/s/media-recorder-forked-1469o
Attachments:
Description Flags
Console errors on playback
none
Patch
none
Patch none

Description Paul 2020-09-02 07:36:45 PDT
Created attachment 407762 [details]
Console errors on playback

Using the latest STP, I'm trying to use the newly available timeslice parameter in the MediaRecorder.start() method. When creating short videos (~10 seconds) things seem to work as expected. However, when creating longer videos (1 minute or greater), the video will only play through a portion of the video and the console will log saying there was an internal webkit error.

Steps to reproduce -
1. Visit https://codesandbox.io/s/media-recorder-6tlzb (sandbox is set to use a 1000ms timeslice)
2. Press "Start Camera" and allow permissions.
3. Press "Start Recording" and let the recording run for 1 minute or longer.
4. Press "Stop Recording"
5. Press "Play"

Actual Results
Playback is shorter than the recorded duration, and the console logs an internal webkit error.
"Failed to load resource: WebKit encountered an internal error"
"Failed to load resource: The operation couldn’t be completed. (WebKitBlobResource error 1.)"

Expected Results
Video plays through the same length as the recorded duration with no errors.

Additional Information:
Release 112 (Safari 14.0, WebKit 15610.1.25.5.1)
macOS 10.15.6 (19G2021)
Comment 1 Radar WebKit Bug Importer 2020-09-02 07:42:54 PDT
<rdar://problem/68209422>
Comment 2 youenn fablet 2020-09-02 07:52:00 PDT
I can repro this issue with the real camera but not the mock one.
Comment 3 youenn fablet 2020-09-02 08:13:12 PDT
Actually no, I just need to wait longer for this error to happen with mock.
I am wondering whether this has to do with the size of the data.
Comment 4 youenn fablet 2020-09-04 07:25:55 PDT
Created attachment 407967 [details]
Patch
Comment 5 youenn fablet 2020-09-04 07:29:21 PDT
Issue is related to blob resource loading.
MediaRecorder can still be used to upload streamed data but it is difficult to directly play it.
Comment 6 youenn fablet 2020-09-04 08:16:13 PDT
Created attachment 407973 [details]
Patch
Comment 7 Eric Carlson 2020-09-04 08:29:17 PDT
Comment on attachment 407973 [details]
Patch

Nice fix!
Comment 8 EWS 2020-09-04 09:11:14 PDT
Committed r266611: <https://trac.webkit.org/changeset/266611>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407973 [details].
Comment 9 Paul 2020-09-08 05:58:07 PDT
Thanks Youenn!!