Closed breakingsword closed 2 years ago
There is no way to guarantee that a codec is available forever; it could be reclaimed due to resource pressure, the loss of a graphics context, or other reasons. I would recommend that WebCodecs applications implement recovery mechanisms such as seek-to-previous-keyframe to recover from decoder loss. Unlike for <video>
, this isn't something that can be hidden because the browser cannot force a WebCodecs application to provide a keyframe.
All that said, the Chrome implementation is currently strict about reclamation, and we are actively working to find the best set of tradeoffs. You can follow https://bugs.chromium.org/p/chromium/issues/detail?id=1277618 to see progress on that effort. You can also pass --disable-features=ReclaimInactiveWebCodecs
if that simplifies your development process.
In addition to the pressure-based reclamation Dan mentioned, we are exploring whether we can always disable reclamation for foreground windows (looks promising).
thanks a lot
I have a video editor web app want to use webcodec. but when I try , I find chrome will relaim decoders that are inactive. User may pause video and do edit video or sth. when user begin to play, decoder has been relaimed. I want to know how to keep this decoder alive?