Notify GMP codec impl of skipped encodings
Categories
(Core :: Audio/Video: GMP, task)
Tracking
()
People
(Reporter: pehrsons, Assigned: pehrsons)
References
(Blocks 2 open bugs)
Details
Attachments
(4 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
Bug 1999970 - Retrofit a Skipped callback on top of GMP encoder API using input frame destroy calls.
48 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-esr140+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-esr140+
|
Details | Review |
See bug 1992567 comment 51 for details. When running the WebRTC GMP OpenH264 encoder at 4k@60 screensharing, it cannot keep up with realtime. It still seems to allocate a buffer to hold the encoded frame, which on skip is immediately dropped -- and to meet bitrate targets, OpenH264 may indeed drop frames. Turning off frame dropping through the API doesn't seem to help.
To avoid what is more or less an unbounded leak, I try to set a hard limit of maximum 1 frame allowed in flight (to the GMP process). When OpenH264 drops a frame however, the WebRTC GMP encoder doesn't learn about this and encoding stalls.
A higher limit (5) seems to work in practice such that we don't have the unbounded leak, but there are no guarantees as we'd again stall the encoding if OpenH264 were to drop 5 frames in a row.
Making the WebRTC GMP encoder synchronous again as per bug 1999747 would also not work, as it also results in an effective limit of 1 frame in flight. Adding a callback to the GMP API for signaling a dropped frame to the client, and implementing this in OpenH264, seems like the best way forward.
| Assignee | ||
Updated•5 months ago
|
| Assignee | ||
Comment 1•5 months ago
|
||
This allows the GMP client (in this case the WebRTC GMP encoder) to know whether
the encoder plugin decided to drop a frame. This lets us avoid flushing the
encoder with more encode jobs than it can handle.
Updated•5 months ago
|
Updated•5 months ago
|
| Assignee | ||
Comment 2•4 months ago
|
||
The OpenH264 encoder may silently drop a frame due to rate control.
If not handled in the GMP PEM, it may risk stalling waiting for an encoded frame
that never arrives.
Comment 4•4 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/9e5dffd97e3a
https://hg.mozilla.org/mozilla-central/rev/39d124ba4e96
| Assignee | ||
Comment 5•4 months ago
|
||
This allows the GMP client (in this case the WebRTC GMP encoder) to know whether
the encoder plugin decided to drop a frame. This lets us avoid flushing the
encoder with more encode jobs than it can handle.
Original Revision: https://phabricator.services.mozilla.com/D272613
Updated•4 months ago
|
| Assignee | ||
Comment 6•4 months ago
|
||
The OpenH264 encoder may silently drop a frame due to rate control.
If not handled in the GMP PEM, it may risk stalling waiting for an encoded frame
that never arrives.
Original Revision: https://phabricator.services.mozilla.com/D274755
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Description
•