Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MP4-Streaming Support in Firefox

1,552 views
Skip to first unread message

Ulrich Aumann

unread,
Dec 13, 2013, 6:24:20 AM12/13/13
to dev-...@lists.mozilla.org
Hello,

I noticed that Firefox had added support for MP4 files with H.264 video and AAC audio. It plays MP4 files very well and also with a progressive download. Unfortunately MP4-Streaming over HTTP via byte serving (aka via Byte-Range requests) does not seem to work in the current version. If I want to start a MP4 Video at a time, which is not already downloaded, I have to wait until the download to this time is completed.

Is there a plan to add MP4-Streaming support via Byte-Range requests in upcoming versions of Firefox?

Because I read that MP4-Support depends on underlying OS support for H.264 decoding: Will this feature depend on the actual OS/device, Firefox is running on?

Greetings,

Ulrich

Ralph Giles

unread,
Dec 13, 2013, 1:54:47 PM12/13/13
to Ulrich Aumann, dev-...@lists.mozilla.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 13/12/13 03:24 AM, Ulrich Aumann wrote:

> Is there a plan to add MP4-Streaming support via Byte-Range
> requests in upcoming versions of Firefox?

It sounds like you're asking about seeking over http Range requests,
since progressive playback during download works. I think we plan to
implement that eventually, but it may be a while. In the meantime I
recommend using a more stream-oriented video format like WebM or Theora.

> Because I read that MP4-Support depends on underlying OS support
> for H.264 decoding: Will this feature depend on the actual
> OS/device, Firefox is running on?

That's true right now because we forward to the whole mp4 stream to
the platform-specific decoder. We're currently rewriting mp4 support
to do the demuxing in native firefox code, and rely on
platform-specific modules only for decode of compressed audio and
video frame data. That will let us support seeking in the same way on
all platforms, but we have to finish the rewrite first.

What will work sooner is the MediaSource extension, which allows a web
page to feed compressed data to the playback pipeline. This allows
direct control over download and buffering. You could use this to
implement your own byte-range seeking in javascript until Firefox
supports is natively, or use one of the libraries for DASH for HTTP
Live Streaming.

We'll be supporting fragmented mp4 playback for the MediaSource
extensions (currently works, behind a pref, in Firefox Aurora or
Nightly on Windows only), then non-fragmented mp4 for normal <video>
playback, and finally seeking, in that order of priority.

That's the current plan, anyway. Hope it helps with your planning.

-r

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSq1f3AAoJEEcAD3uxRB3vbkkH/RNEVVllQKh4qXdFtEus/X9k
YSHDPnr15TndzzeVpGoVE3SZgH2kzcrqesAm4OF078sb58Vuwd84XR/4DGYLQtGO
8lniYQbHCK7AQs4lf163uMWuAZOxF/fGo8D8/bTZO7MdL1jGSU+0/mDD/vpV8X+S
XjmGVWESGh8x3tpt3QheEKWp6k+x8IJ+EKbHrpld8vLOEMuFxlqY4ZXLWWmMC8wA
6XshxbiNFS3Aqlfi8i+4eicAoHFQ3dGYjk2VbsO5SYuO1/mRD/j7VNBD+kC4GTB1
/3RVeA92yMIiuklI+KKmWWNmzPsnjsL5moKg0zKpPMrL0wmPuH6ae74mPHDsfKk=
=Z2OB
-----END PGP SIGNATURE-----

Chris Double

unread,
Dec 13, 2013, 2:48:25 PM12/13/13
to Ulrich Aumann, dev-...@lists.mozilla.org
On Sat, Dec 14, 2013 at 12:24 AM, Ulrich Aumann <ulrich...@gmx.de> wrote:
>
> Because I read that MP4-Support depends on underlying OS support for H.264 decoding: Will this feature depend on the actual OS/device, Firefox is running on?

Seeking in an MP4 file should work fine using byte range requests.
What OS are you on and what version of Firefox? I tested the following
using Firefox Nightly with GStreamer:

<http://cd.pn/b/>

Seeking works immediately for me.

Ulrich Aumann

unread,
Dec 14, 2013, 3:40:25 PM12/14/13
to dev-...@lists.mozilla.org
On Sat, 14 Dec 2013 08:48:25 +1300
Chris Double <chris....@double.co.nz> wrote:

> Seeking in an MP4 file should work fine using byte range requests.
> What OS are you on and what version of Firefox? I tested the following
> using Firefox Nightly with GStreamer:
>
> <http://cd.pn/b/>
>
> Seeking works immediately for me.

Thanks for your answer! Your example also worked for me (Firefox 26.0 on Linux). By investigating your example I also found the bug on my website:

My server did not answer with "206 Partial Content" when there was a GET request to the MP4 file with a "Range: byte=0-" header from the firefox. Instead my server responded with "200 OK". So I guess firefox thought, the server might not support byte range requests.

Thanks for your help!

Ulrich

Ralph Giles

unread,
Dec 14, 2013, 5:28:14 PM12/14/13
to ulrich...@gmx.de, dev-...@lists.mozilla.org
On 2013-12-14 12:40 PM, Ulrich Aumann wrote:

> My server did not answer with "206 Partial Content" when there was a GET request

Aha! Sorry if I confused you with my answer. We'd been talking about
seeking support in the MediaSource example and I incorrectly believed
you about it not working for a normal video element source.

-r

Chris Double

unread,
Dec 14, 2013, 5:45:05 PM12/14/13
to Ulrich Aumann, dev-...@lists.mozilla.org
On Sun, Dec 15, 2013 at 9:40 AM, Ulrich Aumann <ulrich...@gmx.de> wrote:
> My server did not answer with "206 Partial Content" when there was a GET request to the MP4 file with a "Range: byte=0-" header from the firefox. Instead my server responded with "200 OK". So I guess firefox thought, the server might not support byte range requests.

Yes, Firefox decides if the server supports byte ranges if it sends an
"Accept-Ranges" HTTP header or if it responds with a partial content
on a range request. I've only met one web server that does neither of
these (thttp) so far. What web server are you using? Unfortunately I
don't know of a more accurate way of determining support without
making an extraneous request.
0 new messages