H.264 video in Firefox for Android


Firefox for Android
has expanded its HTML5 video capabilities to include H.264 video playback. Web developers have been using Adobe Flash to play H.264 video on Firefox for Android, but Adobe no longer supports Flash for Android. Mozilla needed a new solution, so Firefox now uses Android’s “Stagefright” library to access hardware video decoders. The challenges posed by H.264 patents and royalties have been documented elsewhere.

Supported devices

Firefox currently supports H.264 playback on any device running Android 4.1 (Jelly Bean) and any Samsung device running Android 4.0 (Ice Cream Sandwich). We have temporarily blocked non-Samsung devices running Ice Cream Sandwich until we can fix or workaround some bugs. Support for Gingerbread and Honeycomb devices is planned for a later release (Bug 787228).

To test whether Firefox supports H.264 on your device, try playing this “Big Buck Bunny” video.

Testing H.264

If your device is not supported yet, you can manually enable H.264 for testing. Enter about:config in Firefox for Android’s address bar, then search for “stagefright”. Toggle the “stagefright.force-enabled” preference to true. H.264 should work on most Ice Cream Sandwich devices, but Gingerbread and Honeycomb devices will probably crash.

If Firefox does not recognize your hardware decoder, it will use a safer (but slower) software decoder. Daring users can manually enable hardware decoding. Enter about:config as described above and search for “stagefright”. To force hardware video decoding, change the “media.stagefright.omxcodec.flags” preference to 16. The default value is 0, which will try the hardware decoder and fall back to the software decoder if there are problems (Bug 797225). The most likely problems you will encounter are videos with green lines or crashes.

Giving feedback/reporting bugs

If you find any video bugs, please file a bug report here so we can fix it! Please include your device model, Android OS version, the URL of the video, and any about:config preferences you have changed. Log files collected from aLogcat or adb logcat are also very helpful.

About Chris Peterson

Chris is a developer on Mozilla's Firefox for Android team.

More articles by Chris Peterson…


24 comments

  1. dotnetCarpenter

    wow! great news everyone. I just tested the video on Samsung galaxy tab II and it works flawlessly!
    Firefox beta 18 on android ICS

    November 29th, 2012 at 12:29

    1. Robert Nyman

      Glad to hear it worked well!

      November 30th, 2012 at 00:44

  2. Rakshith

    Good lesson in compromise

    November 29th, 2012 at 13:35

    1. Robert Nyman

      Thanks

      November 30th, 2012 at 00:44

  3. suprsidr

    Great news. I was disappointed in the poor support for webm in my testing. And it seemed .h264 held the widest support. Would be great to get the desktops all in agreeance. http://testr.suprsidr.com/v/video/

    November 29th, 2012 at 14:10

    1. Robert Nyman

      Agreeance is definitely good, and it is of course a big challenge around what that will be.

      November 30th, 2012 at 00:44

  4. 13xforever

    Wtf? Why did Firefox devs stand the ground when the proposal of using 3rd party codecs to decode h.264 on desktop was brought up, but now, suddenly, they are all for it on Android?

    Now I expect either you remove it from ALL versions of Firefox (which is silly) OR add it to ALL versions of Firefox (which is what the community was expecting for a long time). Or else Mozilla would be just a bunch of hypocrites.

    November 29th, 2012 at 22:28

    1. Robert Nyman

      In the article linked to in the first paragraph – Video, Mobile, and the Open Web – everything of it is outlined and discussed in detail by and with Mozilla’s CTO Brendan Eich.

      November 30th, 2012 at 00:43

  5. Rahul

    Great.. it worked on my Android.
    Thanks firefox !

    November 30th, 2012 at 05:36

  6. Andrei

    On my Galaxy S3 with Jelly Bean (4.1.1) the video is with the colors all wrong, should I file a bug report?

    http://imgur.com/a/vwgF7

    November 30th, 2012 at 08:30

    1. Chris Peterson

      hi Andrei, that definitely looks like a bug. <:) We've fixed some similar video bugs on the Galaxy S3, but those bug fixes should already be in Firefox 17. If you could file a bug report, that would be a big help. Another good test is http://videojs.com.

      November 30th, 2012 at 11:30

      1. Andrei

        videojs got the same issues, there is any specific bug that I should comment on or i should file a new one?

        November 30th, 2012 at 11:35

        1. Chris Peterson

          Andrei, I filed a new bug report to track your issue. If you have any additional information or would like to add yourself to the bug’s CC list, the bug report is here: https://bugzilla.mozilla.org/show_bug.cgi?id=817320

          December 1st, 2012 at 12:28

  7. mpmedia

    Finally ! and it works well , congrats to Mozilla moving forward on that matter , i cant wait for your Firefox powered phones !

    December 1st, 2012 at 11:48

  8. pd

    Hopefully the desktop version catches up soon, on XP, on everything!

    December 2nd, 2012 at 10:36

  9. John Thomas

    I was wondering if there were any plans to add H.264 support for Firefox for Linux since Adobe is ceasing support for Flash on Linux as well.

    December 3rd, 2012 at 07:07

    1. Chris Peterson

      John, Mozilla is investigating GStreamer as a possible option for playing H.264 video on Linux. If you would like to track the investigation’s progress, here is the bug report: https://bugzil.la/794282

      December 3rd, 2012 at 09:47

      1. Shmerl

        So Mozilla caves in? What about principal stance on open codecs? Mobile argument was that even if content is provided as WebM, many devices aren’t ready for hardware decoding for it, so H.264 is the only option for performance reasons. On the desktop this argument is irrelevant, so why suddenly give up on it now?

        December 3rd, 2012 at 11:08

  10. Sammo

    I just installed Firefox 19 on my HTC and STILL no video on the MLB site (“No video with supported MIME type found”). I tried everything that has been recommended and no joy. I just can’t see using Firefox at all on my phone when there are so many other great browsers that actually work.

    February 28th, 2013 at 17:15

    1. Robert Nyman [Editor]

      It¨s best that you contact support for Firefox Android to get help.

      March 1st, 2013 at 07:57

  11. Anthony

    The video is working but everytime i went to watch videos in dailymotion i cannot watch using firefox beta. please help. thanks

    March 24th, 2013 at 16:43

    1. Robert Nyman [Editor]

      Please check in with support for that.

      March 25th, 2013 at 04:01

  12. Michael

    great thanks
    works perfect on my LG Optimus 4x HD
    im running on android 4.0.3 and firefox 19.0.2

    April 1st, 2013 at 15:51

    1. Robert Nyman [Editor]

      Good to hear!

      April 2nd, 2013 at 01:06

Comments are closed for this article.