Closed Bug 1057646 Opened 5 years ago Closed 3 years ago

HTML5 <video> support for H.264 via OpenH264

Categories

(Core :: Audio/Video: Playback, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jld, Assigned: jhorak)

References

Details

Attachments

(1 file, 1 obsolete file)

We have an H.264 codec now, by way of OpenH264, and it's already being used for WebRTC.  It could be useful to allow using it for HTML5 <video>, as an alternative to the existing support for OS-provided media facilities (e.g., bug 886181 comment #7).
We'd need a solution for the audio side of things (ie. AAC) for this to be useful I think.
OpenH264 also needs to support Main and High Profile H.264 before it's really useful for <video>.
Blocks: 799318
The OpenH264 project is working on including Main and High Profile, but adding support or licensing for AAC is not on the roadmap.
(In reply to cajbir (:cajbir) from comment #1)
> We'd need a solution for the audio side of things (ie. AAC) for this to be
> useful I think.

Actually, it can be useful without that. Some services are re-encoding animated GIFs as audioless video using h.264. (e.g. Twitter)

Video decoding via OpenH264 could also be useful to provide a consistent codec implementation for video, even if a platform audio codec is needed. Opus or another free audio codec could also be used with h.264 video.
Component: Audio/Video → Audio/Video: Playback
Gecko has the support. We just need a reason to enable it.
To improve the performance of videos?
To avoid problems on pc that don't have the codecs?

If OpenH264 is only for WebRTC is useless for the major people that use the browser for the mainly stuff like social networks and see videos.
(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #5)
> Gecko has the support. We just need a reason to enable it.

As far as I'm concerned, the primary reason to use OpenH264 for HTML5 <video> is that it would give a universal and _consistent_ codec to all platforms. The current support is patchy and buggy and reliant on whatever the system has. This is not a reliable system. It's impossible to test properly on all platforms, as real world systems are messy, and using a system codec means relying on that mess.
(In reply to Daniele "Mte90" Scasciafratte from comment #6)
> To improve the performance of videos?

It doesn't do that.

> To avoid problems on pc that don't have the codecs?

Are you talking about machines that have an AAC decoder but no H.264 decoder. How common are those?

(In reply to Dave Garrett from comment #7)
> As far as I'm concerned, the primary reason to use OpenH264 for HTML5
> <video> is that it would give a universal and _consistent_ codec to all
> platforms. The current support is patchy and buggy and reliant on whatever
> the system has. This is not a reliable system. It's impossible to test
> properly on all platforms, as real world systems are messy, and using a
> system codec means relying on that mess.

OpenH264 doesn't get away from system decoders because you still need an AAC decoder. The advantage of system decoders is that they support hardware acceleration. The system software decoders are generally reliable.
(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #8)
> OpenH264 doesn't get away from system decoders because you still need an AAC
> decoder. The advantage of system decoders is that they support hardware
> acceleration. The system software decoders are generally reliable.

h.264 is unfortunately ubiquitous for video; AAC, on the other hand, does not have to be used. Opus is available for free to all and is currently the best lossy audio codec in existence for virtually all use-cases. There isn't a video codec that can do this, yet.

The system decoders are reliable until they aren't. At minimum, this should be available for when the system ones break.

Also, why doesn't OpenH264 support hardware acceleration? That seems like something worth doing (at least, of course, for mainstream hardware).
Excuse my ignorance but Twitter states "We currently support MP4 and MOV video formats on mobile apps.

On the web, we support the MP4 video format with H264 format with AAC audio. You can upload videos up to 512MB, however you will be prompted to edit videos to 30 seconds or less in length."

Is the lack of ACC audio support the reason video will not play in firefox? If that is so is there not a way to get the video at least to play?
(In reply to crivera99 from comment #10)
> Is the lack of ACC audio support the reason video will not play in firefox?

What platform are you referring to? Which version of Firefox?

> If that is so is there not a way to get the video at least to play?

Which video?
I have windows xp, version 42 I guess they are not supporting XP anymore and that is the problem. Twitter video not working.
(In reply to crivera99 from comment #12)
> I have windows xp, version 42 I guess they are not supporting XP anymore and
> that is the problem. Twitter video not working.

This bug is about adding a new feature, not existing video playback support. However, this new feature would help you, as I don't think we ever added support for h.264 <video> on WinXP. I think it's Vista and up due to WinXP lacking the needed support, itself. That said, supporting WinXP isn't a sufficient reason to do anything anymore, by itself, at least.
(In reply to Dave Garrett from comment #13)
> This bug is about adding a new feature, not existing video playback support.
> However, this new feature would help you, as I don't think we ever added
> support for h.264 <video> on WinXP. I think it's Vista and up due to WinXP
> lacking the needed support, itself. That said, supporting WinXP isn't a
> sufficient reason to do anything anymore, by itself, at least.

Supporting MP4 playback on Windows requires both H.264 and AAC support to get video and audio. We are looking for a solution for Windows XP.
May this topic be related with
https://bugzilla.mozilla.org/show_bug.cgi?id=1230785

?
OpenH264 isn't useful for video playback so I'm going to close this bug.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
may it be useful in case like this (desperate) one?
https://bugzilla.mozilla.org/show_bug.cgi?id=1222272#c86
> OpenH264 isn't useful for video playback so I'm going to close this bug.

Could you clarify why do you think it is not useful?
Flags: needinfo?(ajones25)
(In reply to KOLANICH from comment #20)
> > OpenH264 isn't useful for video playback so I'm going to close this bug.
> 
> Could you clarify why do you think it is not useful?

I'm curious why this comment has been associated with me...
I just got a 'Need Info' email in my work account: I can't remember using Bugzilla, and at first assumed it was a phishing attack...
In any case, I'm not ajones@mozilla.com
Flags: needinfo?(ajones25)
Duplicate of this bug: 1340101
Flags: needinfo?(ajones)
(In reply to KOLANICH from comment #20)
> > OpenH264 isn't useful for video playback so I'm going to close this bug.
> 
> Could you clarify why do you think it is not useful?

OpenH264 is not useful because it is too slow for playback purposes and doesn't support b-frames. I'm not aware of any platforms that have an AAC decoder but are missing an H.264 decoder. You could encode adverts so that OpenH264 can play them but it would make more sense to use WebM.
Flags: needinfo?(ajones)
Attached patch openh264.patch (obsolete) — Splinter Review

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

Assignee: nobody → jhorak
Attachment #9065016 - Attachment is obsolete: true

Added also fdk-aac for audio playback and media.ffmpeg.preferred preference for giving system ffmpeg lib higher.

You need to log in before you can comment on or make changes to this bug.