WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: firefox: enable HTML5 video + audio  (Read 24415 times)

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
firefox: enable HTML5 video + audio
« on: June 06, 2015, 05:05:55 AM »
I had some trouble getting HTML5 av working in Firefox, but all set now. In case anyone else goes this way, this is what is working for me on an Acer C720 Chromebook running TC 6.x.

If anyone has luck without pulseaudio (ALSA only) or just has a faster/slimmer way, I'll be interested to hear.

1) Turn on dbus from ~/.X.d . I use:
Code: [Select]
/usr/local/share/etc/init.d/dbus start
2) Turn on pulseaudio from ~/.X.d . I use:
Code: [Select]
/start-pulseaudio-x11
3) Install extensions. Installation order sometimes matters. ffmpeg, gst-ffmpeg, and the gstreamer plugins need to be in place at the time firefox is started. Perhaps not necessary to on-boot, but this is what I do:

- dbus [onboot]
- alsa-config [onboot]
- alsa [onboot]
- pulseaudio [onboot]
- ffmpeg
- gst-ffmpeg
- gst-plugins-good0.10
- gst-plugings-ugly0.10
- firefox-official (I used firefox-get.tcz to create this)

4) Start firefox. Browse to about:config and change the following values:

media.fragmented-mp4* = true
media.fragmented-mp4.use-blank-decoder = false [if you're getting green video blocks, this is probably not set correctly]
media.mediasource.enabled = true
media.mediasource.mp4.enabled = true

5) Test via YouTube or an online HTML5 Video/audio test page. First bug check is to just restart firefox.

In my case, failed video was due to missing extensions: gst-plugins-ugly with x264 provides mp4 playback. Failed audio was due to an incorrect system audio setup: ALSA alone fails; gst-plugins-good gives firefox access to pulseaudio.

HTH

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: firefox: enable HTML5 video + audio
« Reply #1 on: June 06, 2015, 11:28:49 AM »
Great, thanks for this info

however...
Quote
firefox-official (I used firefox-get.tcz to create this)
firefox-get is outdated, instead use the updated firefox-latest extension (based on firefox-get) which will auto-detect and create a firefox-official extension based on the latest version of firefox, or a version of your choice if specified for both tc5.x & tc6.x  in  x86 & x86_64 repo's

The thought now crossed my mind to rename the firefox-latest to firefox-get  and continue with updates to that extension ?? 

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: firefox: enable HTML5 video + audio
« Reply #2 on: June 07, 2015, 03:48:18 AM »
Thanks for this, coreplayer. I think you're right - I would have used the firefox-latest extension. Typo on my part.

I'll fix the original text, above =)

EDIT: Hmm. Or maybe I won't - no edit tab there now. Must be new timeout policy since I was last in :p

Offline pq5190362

  • Sr. Member
  • ****
  • Posts: 286
Re: firefox: enable HTML5 video + audio
« Reply #3 on: October 17, 2015, 05:35:14 PM »
If anyone has luck without pulseaudio (ALSA only) or just has a faster/slimmer way, I'll be interested to hear.

[...]

In my case, failed video was due to missing extensions: gst-plugins-ugly with x264 provides mp4 playback. Failed audio was due to an incorrect system audio setup: ALSA alone fails; gst-plugins-good gives firefox access to pulseaudio.

Unfortunately the Firefox extensions in the Tiny Core Linux repos are not built with --enable-gstreamer=1.0 and therefore Firefox can only use the old and outdated GStreamer 0.10 instead of the new GStreamer 1.0 (1.x).

I've asked coreplayer2 to build the Firefox extensions with --enable-gstreamer=1.0 in the respective thread:

http://forum.tinycorelinux.net/index.php/topic,18943.0.html

On Ubuntu 15.10 for example, Firefox is built with --enable-gstreamer=1.0 and then gst-plugins-ugly does not seem to be needed. gst-plugins-base and gst-plugins-good seem to suffice when using GStreamer 1.0 (1.x), at least on Ubuntu.

So, it would be really nice if coreplayer2 would build the Firefox extensions with --enable-gstreamer=1.0.

Regards
« Last Edit: October 17, 2015, 06:00:06 PM by pq5190362 »

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: firefox: enable HTML5 video + audio
« Reply #4 on: October 17, 2015, 06:04:27 PM »
Ah - of course. I think coreplayer2 has focused on wrapping pre-built binaries, but this definitely points in the right direction for a build script. I'll experiment with this.

Sent from my HTC_0P6B6 using Tapatalk


Offline pq5190362

  • Sr. Member
  • ****
  • Posts: 286
Re: firefox: enable HTML5 video + audio
« Reply #5 on: October 17, 2015, 06:28:45 PM »
Ah - of course. I think coreplayer2 has focused on wrapping pre-built binaries

The official Linux binaries from Mozilla are not built with --enable-gstreamer=1.0 yet, see:

https://bugzilla.mozilla.org/show_bug.cgi?id=947287

As you can read over there, currently it's still up to the distro maintainers to decide whether or not they build Firefox with --enable-gstreamer=1.0, since apparently some distros still are relying on the old and outdated GStreamer 0.10 and do not have the new GStreamer 1.x in their repos yet.

Ubuntu for example has GStreamer 1.x and it has Firefox built with --enable-gstreamer=1.0.

Since Tiny Core Linux also has GStreamer 1.x in it's repos already, it should also have it's Firefox extensions built with --enable-gstreamer=1.0 IMHO.

It would be really nice if someone would do it.

Regards

Offline pq5190362

  • Sr. Member
  • ****
  • Posts: 286
Re: firefox: enable HTML5 video + audio
« Reply #6 on: October 17, 2015, 06:33:51 PM »
PS:

Whoops, actually it seems like HTML5 video soon will be done via FFmpeg/Libav instead of GStreamer, see:

https://bugzilla.mozilla.org/show_bug.cgi?id=1212916
https://bugzilla.mozilla.org/show_bug.cgi?id=1207429
https://bugzilla.mozilla.org/show_bug.cgi?id=1213499

 ;)

Regards

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: firefox: enable HTML5 video + audio
« Reply #7 on: October 17, 2015, 07:24:42 PM »
All that makes sense - I think gstreamer-0.10 wasn't enough to get my current ff working with a/v. Had to add ffmpeg and such.

I'll see if I can whip up a flexible extension builder that downloads the current source.

Sent from my HTC_0P6B6 using Tapatalk


Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
Re: firefox: enable HTML5 video + audio
« Reply #8 on: October 18, 2015, 01:02:17 AM »
FYI - html5 works with epiphany with the default deps

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: firefox: enable HTML5 video + audio
« Reply #9 on: October 18, 2015, 02:42:45 AM »
Firefox > YouTube > HTML5 - Video with sound has been supported for quite some time


I watch HTML5 video in Firefox all the time though I prefer using flash
Am I missing something?

Offline pq5190362

  • Sr. Member
  • ****
  • Posts: 286
Re: firefox: enable HTML5 video + audio
« Reply #10 on: October 18, 2015, 05:12:38 AM »
Firefox > YouTube > HTML5 - Video with sound has been supported for quite some time

I watch HTML5 video in Firefox all the time though I prefer using flash
Am I missing something?

Yes, you do seem to miss something, but let me explain ;):

First of all, I guess this thread is not really about HTML5 video in general, but rather specifically about MP4 (H.264 video / AAC audio) instead.

Yes, of course Firefox supports HTML5 video and audio for quite some time.

But there's a difference between WebM (VP8/VP9 video and Vorbis/OPUS audio) and MP4 (H.264 video and AAC audio).

Firefox for Linux supports WebM directly, but not MP4.

On Linux, Firefox currently relies on GStreamer to play MP4 (H.264/AAC) via HTML5.

Currently Firefox makes use of the old and outdated GStreamer 0.10 by default.

But since Firefox 30, it can also use the new GStreamer 1.x, see: https://bugzilla.mozilla.org/show_bug.cgi?id=806917.

But GStreamer 1.x currently is not being used by default, see: https://bugzilla.mozilla.org/show_bug.cgi?id=947287.

To make Firefox use the new GStreamer 1.x, you need to build it with:

Code: [Select]
--enable-gstreamer=1.0
;)

On Ubuntu for example, Firefox is built with --enable-gstreamer=1.0, so that it uses the new GStreamer 1.x.

So, it would be nice if firefox-ESR.tcz and firefox-getLatest.tcz would also be built with --enable-gstreamer=1.0, so that Firefox on Tiny Core Linux would also use the new GStreamer 1.x.

For the 5.x x86_64/6.x x86_64 repos this would even be mandatory for MP4 playback in Firefox, because the 5.x x86_64/6.x x86_64 repos do not have gst-ffmpeg.tcz (which would be for GStreamer 0.10). They only have gst-libav.tcz, which is for GStreamer 1.x.

By the way:

Starting with Firefox 43 or 44, Mozilla seems plan to do MP4 (H.264/AAC) HTML5 video on Linux directly via FFmpeg/Libav instead of GStreamer, so that GStreamer will no longer be needed, see:

https://bugzilla.mozilla.org/show_bug.cgi?id=1207429

Actually I have just tested the latest Firefox Nightly 44.0a1 on Ubuntu and set media.gstreamer.enabled to false in about:config and completely uninstalled GStreamer and Firefox Nightly 44.0a1 could still play MP4 (H.264/AAC) via HTML5 and all the boxes on youtube.com/html5 were still checked :) :D.

So, GStreamer indeed is no longer required with Firefox 44 to be able to play MP4 via HTML5 :). The only thing that needs to be installed is FFmpeg/Libav and then Firefox 44 can play MP4 via HTML5 :). From reading https://bugzilla.mozilla.org/show_bug.cgi?id=1207429 and all the associated bugs, it seems like this might actually even work on Firefox 43 already, but not sure, I've only tested Firefox 44.

Anyway:

Since it will take quite a few more weeks for firefox-getLatest.tcz to reach version 43 or 44 and even months for firefox-ESR.tcz to reach version 45 (the next ESR version), it would still be nice if firefox-ESR.tcz and firefox-getLatest.tcz would be built with --enable-gstreamer=1.0 until then.

If that would be easy, then it would be nice if you could do it.

But if it would involve a lot of extra work, then I'd say it might probably be better to simply leave it as is and simply wait for Firefox to reach version 43 or 44 and for Firefox ESR to reach version 45, since it will no longer need GStreamer then ;).

Regards
« Last Edit: October 18, 2015, 05:40:54 AM by pq5190362 »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: firefox: enable HTML5 video + audio
« Reply #11 on: October 18, 2015, 03:13:24 PM »
html5 video is supported, however I agree H.264 support is not yet supported, but I believe that's just a matter of time.




Offline pq5190362

  • Sr. Member
  • ****
  • Posts: 286
Re: firefox: enable HTML5 video + audio
« Reply #12 on: October 18, 2015, 03:47:10 PM »
html5 video is supported, however I agree H.264 support is not yet supported, but I believe that's just a matter of time.

Sorry, but did you even read my post :o :-\?

If you would have read my post, then you would know that H.264 is already supported...

All you need to do is install:

ffmpeg.tcz
gstreamer0.10.tcz
gst-plugins-base0.10.tcz
gst-plugins-good0.10.tcz
gst-plugins-bad0.10.tcz
gst-plugins-ugly0.10.tcz
gst-ffmpeg.tcz

and making sure that media.gstreamer.enabled is set to true in about:config, then Firefox can do MP4 (H.264/AAC)...

That was even explained in post #1 by dentonlt...

What I asked you to do is building Firefox with --enable-gstreamer=1.0, so that one can use the NEW 1.x versions of:

gstreamer.tcz
gst-plugins-base.tcz
gst-plugins-good.tcz
gst-plugins-bad.tcz
gst-plugins-ugly.tcz
gst-libav.tcz

instead of the OLD 0.10 versions...

Regards

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: firefox: enable HTML5 video + audio
« Reply #13 on: October 18, 2015, 05:04:40 PM »
I'm talking about native support, which I think is inevitable..
 

Additionally, the goals of firefox-getLatest.tcz are:

1: provide an effective means to install the latest firefox release from scratch
2. provide ability to update a previous installed firefox version to the latest release
3. minimize the confusion from having various firefox versions in the repo

We accomplish this with a script "firefox-getLatest.sh" which downloads the latest stable prebuilt Firefox binary release (and if specified in a users language) direct from Mozilla.  Then package the extension per tinycore's specifications for immediate use.   

To cut a long story short; While Mozilla continue to provide prebuilt stripped and stable firefox binaries, we have no requirement to compile our own binaries.  therefore compiling with the --enable-gstreamer=1.0 option is a request for upstream Mozilla.

regards



Offline pq5190362

  • Sr. Member
  • ****
  • Posts: 286
Re: firefox: enable HTML5 video + audio
« Reply #14 on: October 18, 2015, 05:22:04 PM »
Okay.

therefore compiling with the --enable-gstreamer=1.0 option is a request for upstream Mozilla.

https://bugzilla.mozilla.org/show_bug.cgi?id=947287

I'm talking about native support, which I think is inevitable..

Well, as already mentioned, beginning with Firefox 43 or 44, GStreamer will no longer be needed (only FFmpeg/Libav will be needed):

https://bugzilla.mozilla.org/show_bug.cgi?id=1207429

Regards