Closed Bug 2092919 Opened 16 days ago Closed 12 days ago

[wpt-sync] Sync PR 64652 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=281816

Categories

(Core :: Audio/Video: Recording, task, P4)

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 64652 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/64652
Details from upstream follow.

Jean-Yves Avenard <jya@apple.com> wrote:

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=281816

WebKit export from bug: All MediaRecorderPrivate should be running in the web content process.<!---->

<pre>
All MediaRecorderPrivate should be running in the web content process.

We extend on the work started with the MediaRecorderPrivateWriterWebM introduced in <a href="https://commits.webkit.org/285061@main">285061@main</a>.
We add a new MediaRecorderPrivateEncoder that performs the encoding, encoded frames interleaving management
and writing through the specialised MediaRecorderPrivateWriter.

This new MediaRecorderPrivate can encode into any audio codec supported by AVFoundation (though only opus and AAC is enabled for now)
and all video codecs supported by VideoEncoder with webm (vp8, vp9) and mp4 (h264, h265, av1).

The code runs in its dedicated WorkQueue.

One of the key change which added a significant amount of technical complexity is that while we will generate 2s GOP
a call to MediaRecorder.requestData() will return fully playable media segment, formed such as each new segment starts
with a keyframe. The generated media is MSE compatible.
This way, the page fully controls the duration of the media segments generated by either setting
a time slice when creating a MediaRecorder or calling requestData() at regular interval.

When a new segment is required by the page, we flush all pending frames received to that point. As the audio encoder
has a certain latency, we may need to wait for a future audio frame to come which would allow the audio for the
current time to be available. When we are streaming, this is not a problem ; however if the recording has been paused
no audio will be coming. So instead will fully drain the encoder. As a side effect, resuming the recording
may cause an audible silence for the duration of the codec delay (55ms with Opus content).
In practice, this may not be noticeable as pausing and resuming a recording would produce noticeable
artifacts with audio.

Another technical change with the previous webm recorder is that the video time is now set to use
the start time of the last appended audio frame rather than the end. This too is also a consequence of the audio encoder
having a set latency and allowed for some simplifications in the code.

The new MediaRecorder add supports for the codec to be set and the mimetype for the content generated will
be mostly accurate (we use static values with common profiles rather than attempting to determing accurately
things like the codec level and profile.

The RemoteMediaRecorder being no longer used is fully removed along the related files.
The class MediaRecorderProvider and its overrides are removed.

Tests amended and corrected to reflect the more accurate behaviors.

Upstream has changed this file since WebKit last imported it, so this applies the change to upstream's current version. Its video regexes now also allow x- subtypes, so digits are allowed in the other alternative.

WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=281816">https://bugs.webkit.org/show_bug.cgi?id=281816</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/285726@main">https://commits.webkit.org/285726@main</a>
</pre>

Component: web-platform-tests → Audio/Video: Recording
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 120 tests and 5 subtests

Status Summary

Firefox

OK : 1[GitHub] 116[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview] 117[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 248[GitHub] 693[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview] 696[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 11[GitHub] 47[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 48[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview]

Chrome

OK : 1
PASS: 243
FAIL: 19

Safari

OK : 1
PASS: 236
FAIL: 24

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

Status: NEW → RESOLVED
Closed: 12 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.