-
-
Notifications
You must be signed in to change notification settings - Fork 833
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
web,video: Add H264 decoding using the WebCodecs API #16794
base: master
Are you sure you want to change the base?
Conversation
65c01d8
to
e9c744b
Compare
e9c744b
to
877b6b1
Compare
816e327
to
c96c40c
Compare
c96c40c
to
43a992c
Compare
9afffe8
to
d40c036
Compare
c47534e
to
f3bd05b
Compare
35cf89c
to
bf5c71c
Compare
74cf97b
to
cf85e0f
Compare
Rebased on top of #17878. |
cf85e0f
to
033a7c7
Compare
033a7c7
to
f4edc57
Compare
98302d1
to
d45c3de
Compare
9250fe2
to
8132286
Compare
8132286
to
c6a19de
Compare
))); | ||
} | ||
_ => { | ||
panic!("unsupported pixel format: {:?}", output.format().unwrap()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Admittedly I'm not great with Rust, but does it make sense to panic if this is any other format?
https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame/format and https://rustwasm.github.io/wasm-bindgen/api/web_sys/enum.VideoPixelFormat.html lists a lot more formats than just I420 and BGRX. Is it possible to embed a video in any of those other formats with Flash, and if so, wouldn't the whole thing panic when trying to play them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, good point, this is not nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced the panic with a simple error log. We can add conversion from other formats as needed.
I think what we get here depends on the browser more than the encoded content.
These two were chosen because they were returned by Chrome and Firefox in my testing, on my systems.
55e577c
to
a326514
Compare
a326514
to
345b343
Compare
A continuation of #14654.
Not really done yet, just pushing for visibility, and so that it doesn't get forgotten.
(Just look at the commit history lol.)Due to this API being based on callbacks, this currently adds at least one additional (video) frame of delay as compared to a synchronous decoder, such as OpenH264 on desktop. I think this should be acceptable.
It would be possible to wire the callback straight from the browser through the video backend to the renderer backend, to update the texture immediately (off the regular frame pacing schedule), but I think that would be a bit too complicated, and could potentially result in less smooth playback.
Mostly works, in Chrome and in Firefox 129+.
I don't think this could be problematic at all from a patents/licensing/royalty standpoint.
Advances #8891.