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
Add H.264 decoding by utilizing OpenH264 from Cisco #14654
base: master
Are you sure you want to change the base?
Conversation
This is what I use to test this at the moment: I hope it's okay to upload here. Despite the name, it now loads an FLV file. It's originally from here: https://permadi.com/2010/02/flash-playing-flvf4v-videos-with-script/
|
50cbcdb
to
7b9cfe9
Compare
7a9b39d
to
9f5213a
Compare
9f5213a
to
d0a74d3
Compare
94a9b3d
to
ae7005d
Compare
bab9a41
to
ff4890b
Compare
9c9c068
to
8d13939
Compare
18ec491
to
1aad82a
Compare
The VideoDecoder part of WebCodecs (and many other APIs) are only available in secure contexts, right (they're also not yet available in Firefox but I'm sure that will change)? Will this be the case in insecure contexts too? I suppose browsers are moving away from allowing insecure sites at all. |
Certainly, since it already works if enabled in
I have no idea. Anyway, we can keep the current solution if VideoDecoder is not available for whatever reason. |
f17d412
to
a49f46d
Compare
a49f46d
to
2416cac
Compare
5c2e789
to
39b4d39
Compare
05a60c4
to
89ffdab
Compare
I'm not entirely sure how enablement should be handled w.r.t. #16310... 🤔 ...as this is entirely desktop-specific. |
Maybe this should be in preferences instead and have an option to also toggle it in the UI? |
Hahah, yeah, you're right, there just weren't preferences yet when I started working on it, and they didn't come to my mind just now... 😅 |
89ffdab
to
c096b37
Compare
Made the toggle a preference now, instead of a command line option. |
c096b37
to
7366024
Compare
7366024
to
c5d2ea6
Compare
There's now a bit of a back-and-forth between |
eb80586
to
9c1a349
Compare
Featuring the legendary Big Buck Bunny.
9c1a349
to
69cb774
Compare
This is very much a WIP.Progresses #723.Basically pushing only for visibility.Will partially replace #12539 (first only on desktop, in the future, using WebCodecs, entirely).AFAIK this is the only legal way (without us or our users having to pay royalties to
MPEG LAVIA LA) to do this with reasonable portability on desktop, but IANAL. See this little explainer video: https://vimeo.com/79578794The code is somewhat based on the
openh264-rs
crate, see ralfbiedert/openh264-rs#43.YUV->RGB colorspace conversion is done by our trusty handcrafted code, like for H.263 and VP6[A]. This means that it will always assume BT.601 coefficients, even though it could theoretically, possibly be BT.709 or something like that. But the difference is probably subtle enough anyway.
TODOs, in no particular order:
configure_decoder
(or similar) method to the video backend/decoder traits.Currently the preload method is misused to pass the "extradata" to the decoder.Index
es for proxied and handled videos in the ExternalBackend.OpenH264-license.txt
upon creation.--enable-openh264 [true|false]
SBufferInfo
struct from the decoder.TODOs for later:
<video>
element would be a feasible fallback - probably not, but who knows.I plan to put this into the same
ExternalVideoBackend
added here. Also with the "other ideas" below. Spares us from duplicating the proxying logic. The Android backend will have to be different though, as it's somewhere else.Somewhat less closely related TODOs for later:
Other ideas: