-
Notifications
You must be signed in to change notification settings - Fork 143
How to express encoded size vs. visible size vs. natural size #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The only minimal example that can point to is the encoding of a video If input is 400x300, 300x150 spanning two seconds, one second each respectively, the API should ensure (by testing) the output will be 400x300 one second, 300x150 once second. Not only 400x300 for the entire two seconds. Or arbitrary output, e.g., Epiphany Technology Preview, which scales larger frames to lower resolutions and scales smaller frames to larger resolutions when variable resolution frames are encoded in the video track. The API should not arbitrarily encode the image in such a way as the output will be dissimilar from the input unless explicitly set. |
Is this issue addressing settings (expectedWidth/expectedHeight)? Or stats? |
expectedWidth/expectedHeight is just for faster codec initialization (it's slower if you wait for the first frame). I was thinking something more like for decode:
As for encoding, I need to learn more about what one would expect to happen if you passed in a resolution that doesn't fit macro blocks. |
It's addressing the metadata of the output frame from the decoder. |
Do not do this Chromium does not dispatch resize event for variable resolution frames and MediaStreamTrack.getSettings() outputs incorrect values for width and height for WebM video output by MediaRecorder at Chromium (arbitrarily change the output to suit only the perspective of the author of the source code, emitting incorrect values relevant to the actual underlying encoded frame). |
Does this issue cover how values are expressed for the decoder portion of WebCodecs?
Kindly clarify if |
It must be pointed out here that the value of size of the encoded frame will be moot if the decoder does not read each frame when the developer intentionally encodes variable resolution frames intended to be output at HTML It may be necessary to consider a WebMediaPlayer (with capability to select and de-select the appropriate decoder) to substitute for HTML An implementer of browser video decoders and HTML |
For the root question of "how to expose", please see the solution in draft spec for the VideoFrame interface. I'll give a summary of the current situation below. Please open new bugs for specific issues with this proposal.
VideoFrame has all three. Self explanatory. VideoDecoderConfig has all three. This matches existing generic codec APIs like FFmpeg where not all codecs used have a provision to describe their size in-band. For codecs that do have that capability, the config stuff is just an initial hint. In chrome, we will use the initial VideoDeocderConfig to pin pixel aspect ratio (PAR) for the stream, while allowing display aspect ratio (DAR) to change per frame. This has been the longstanding behavior of Chrome's We will not put any size info in the EncodedVideoChunk. We don't have any use for it. We will put both display size and crop size in VideoEncoderConfig. Crop size is the critical bit, but display size is also nice to have for encoders that want to describe that in-band. Right now the encoder API only has a vague width and height - we'll fix that (#93). |
When we express sizes, how do we distinguish between encoded size, visible size, and natural size. From what I understand:
The text was updated successfully, but these errors were encountered: