w3c / webcodecs

WebCodecs is a flexible web API for encoding and decoding audio and video.
https://w3c.github.io/webcodecs/
Other
985 stars 136 forks source link

Probably a silly question: can this encode irregularly spaced frames? #740

Closed o0101 closed 11 months ago

o0101 commented 11 months ago

I'm sorry I'm not sure how to describe this simply, so I'll just relate the use case:

Chrome DevTools Protocols has a Page.startScreencast method. While the reality may be complex, consider that it simply generates frames on any redraw of the rendered page. For instance, redraws and frames in response to a person interacting with the page.

These frames may be emitted at irregular intervals. Maybe there's 5 seconds of "silence", then a flurry of frames. And so on.

Can this sort of imagery be converted into accurate and efficiently compressed video stream at all? And, can webcodecs encode this?

Again, I'm sorry to ask as I'm sure this is already spelled out somewhere. I'm afraid I'm no expert did not find a certain answer here or elsewhere!

sandersdan commented 11 months ago

Variable frame rate is in some sense the default, but there are some extra considerations: