HTML5 <video> support for H.264 via OpenH264
Categories
(Core :: Audio/Video: Playback, enhancement)
Tracking
()
People
(Reporter: jld, Assigned: stransky)
References
Details
Attachments
(1 file, 8 obsolete files)
44.45 KB,
patch
|
Details | Diff | Splinter Review |
Comment 1•10 years ago
|
||
Comment 2•10 years ago
|
||
Comment 3•10 years ago
|
||
Comment 4•10 years ago
|
||
Updated•9 years ago
|
Comment 6•9 years ago
|
||
Comment 7•9 years ago
|
||
Comment 9•9 years ago
|
||
Comment 10•9 years ago
|
||
Comment 12•9 years ago
|
||
Comment 13•9 years ago
|
||
Comment 15•9 years ago
|
||
Comment 19•8 years ago
|
||
Comment 20•8 years ago
|
||
Comment 21•8 years ago
|
||
Comment 24•6 years ago
|
||
For those who might be interested in using openh264 for h264 playback, I've attached the patch. With current openh264 version, only baseline profile works, also there's missing aac codec for audio playback.
There's some move forward regarding B-frame support: https://github.com/cisco/openh264/issues/2981
Updated•6 years ago
|
Comment 25•6 years ago
|
||
Added also fdk-aac for audio playback and media.ffmpeg.preferred preference for giving system ffmpeg lib higher.
Comment 26•5 years ago
|
||
Just to explain/update Jan's comments:
As of v2.0 OpenH264 supports the main and high profiles and should work for most H.264 files. AAC support can be handled by FDK-AAC-Stripped, which is a version of FDK-AAC with all of the patented bits stripped out.
FDK-AAC has a non-standard license, but Redhat legal and the FSF consider it to be free software, although Debian has placed it in their non-free repo. WRT patents, Redhat legal has green-lit the use of FDK-AAC-Stripped in mainline.
It might be time to reconsider using OpenH264 for videos, given that H264 patents will be around until ~2027. But it is more code to maintain for a feature that is best handled using system libraries or hardware decoders....
I'm no longer involved in media playback, but I can give some commentary.
The forward direction for this (ignoring the long tail) is to get people using VAAPI through Wayland. The openh264 path exists but last time I checked (years ago) the performance was poor. Playback is more demanding on the CPU than video calls and openh264 was only single threaded (that may not still be true).
Widevine includes support for encrypted H.264, so once you get AAC you get most of the premium (DRM-based) services working. YouTube uses free codecs so that will also work. What you're left with is a bunch of sites that all have different player implementations and you can't rely on them responding to dropped frames should openh264 fail to keep up.
Any decisions about this are up to Nils.
Nils - any thoughts or has anything changed since last I looked at this?
Assignee | ||
Comment 28•5 years ago
|
||
Folks, can be this patch included as a Tier-3 which means Mozilla will not use this code path but it will be used by distros which can't use ffmpeg by default like Fedora/RHEL?
Updated•5 years ago
|
Assignee | ||
Comment 29•4 years ago
|
||
I'm going to work on that. This is important to have it as Chromium already ships it and can play H.264 clips out of the box but Firefox fails so people are directed to use Chrome/Chromium.
The OpenH264 codec already supports the high profile and should be used only when system ffmpeg is missing and we're requested to play H.264 clips.
Assignee | ||
Comment 30•4 years ago
|
||
Also I think the final solution should be incorporated with Bug 1660336 as we may:
- use system ffmpeg first if VA-API is enabled and recent enough
- fall back to bundled (ffvpx) for VP9/8
- try system ffmpeg
- fallback to openh264 when system ffmpeg is missing
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 31•4 years ago
|
||
Assignee | ||
Comment 32•4 years ago
|
||
Depends on D89343
Assignee | ||
Comment 33•4 years ago
|
||
Depends on D89344
Assignee | ||
Comment 34•4 years ago
|
||
Depends on D89345
Assignee | ||
Comment 35•4 years ago
|
||
Depends on D89346
Assignee | ||
Comment 36•4 years ago
|
||
- Add empty EnableOpenH264Decoder() method to PlatformDecoderModule.
- Implement it for ffvpx FFmpegDecoderModule module by mIsOpenH264Enabled attribute.
Depends on D89347
Assignee | ||
Comment 37•4 years ago
|
||
Depends on D89348
Comment 38•4 years ago
|
||
We already have a OpenH264 decoder via the GMP.
It can be used for HTML5 video so long as it's prefed on. The lack of support for the high profile was an issue in the past, we would need to update the GMP component.
However, this doesn't solve the case where OpenH264 is provided by Cisco and needs to be installed regardless, and on Android it appears we will no longer be able to install the OpenH264 plugin unless we use the playstore.
Comment 39•4 years ago
|
||
(In reply to Martin Stránský [:stransky] from comment #29)
I'm going to work on that. This is important to have it as Chromium already ships it and can play H.264 clips out of the box but Firefox fails so people are directed to use Chrome/Chromium.
I don't believe that's the case.
Chrome can play h264 out of the box, but not Chromium.
The OpenH264 codec already supports the high profile and should be used only when system ffmpeg is missing and we're requested to play H.264 clips.
Then we need to update the various OpenH264 plugin and let the GMPDecoderModule be a default for video decoding
https://searchfox.org/mozilla-central/source/dom/media/platforms/PDMFactory.cpp#398-404
and for that to work the pref media.gmp.decoder.enabled needs to be turned on.
https://searchfox.org/mozilla-central/source/modules/libpref/init/StaticPrefList.yaml#7149-7152
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Description
•