Closed Bug 833023 Opened 11 years ago Closed 11 years ago

Implement VP9 video decoder in Firefox

Categories

(Core :: Audio/Video, enhancement)

enhancement
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla28
Tracking Status
relnote-firefox --- 28+

People

(Reporter: markus.popp, Assigned: j)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-needed, feature)

Attachments

(1 file, 2 obsolete files)

VP9, being an open and royalty free video compression standard and the successor of VP8 has recently been implemented in Chromium, and should be supported by Firefox too.

http://src.chromium.org/viewvc/chrome?view=rev&revision=172738
Component: General → Video/Audio
Product: Firefox → Core
Whiteboard: [fuzzing:?]
Whiteboard: [fuzzing:?] → [fuzzing:]
Whiteboard: [fuzzing:] → [fuzzing:queue:rforbes]
Should this be marked parity with Chrome? Chrome supports VP9 as of version 25.

http://en.wikipedia.org/wiki/VP9
http://www.youtube.com/watch?v=K6JshvblIcM

Hope VP9 decoding support can be implemented soon, VP9 is big improvement over VP8.
"Chromium has VP9 decoding support enabled by default in latest chrome builds."
and youtube already begin to encode video on vp9

come on mozilla, you was late for h264, now you are late for vp9 ...
The final bitstream codec hasn't even been released yet. It's due to be released tomorrow actually.

https://groups.google.com/a/webmproject.org/forum/?fromgroups=#!topic/webm-discuss/UzoX7owhwB0

What Google has put in Chrome already was the test/beta versions. When the spec is final we'll evaluate inclusion in Firefox.
Blocks: 881512
Blocks: MSE
Attached patch mozilla-central_vp9.patch (obsolete) — Splinter Review
needs https://github.com/kinetiknz/nestegg/pull/13 to be pulled into mozilla-central tree and libvpx with vp9 support (i.e. via --with-system-libvpx)
Depends on: 918550
Thanks, Jan! I've filed bug 918550 about updating our in-tree libvpx.
Adding Bug 884275 to allow for proper script detection of VP9 support in Fx.
Depends on: 884275
Attached patch 0001-add-vp9-support_v2.patch (obsolete) — Splinter Review
- rebase patch on top of inbound + Bug 918550
- add vpx_codec_vp9_dx/vpx_codec_vp9_cx to layout/media/symbols.def.in
Attachment #807350 - Attachment is obsolete: true
Attachment #8341614 - Flags: review?(cpearce)
Comment on attachment 8341614 [details] [diff] [review]
0001-add-vp9-support_v2.patch

Review of attachment 8341614 [details] [diff] [review]:
-----------------------------------------------------------------

Please make the following changes, and then request review from kinetik, he reviews WebMReader.

::: content/media/webm/WebMReader.cpp
@@ +281,4 @@
>          Cleanup();
>          return NS_ERROR_FAILURE;
>        }
> +      mVideoCodec = nestegg_track_codec_id(mContext, track);

To reduce the cleanup paths, please change this block to:

  vpx_codec_iface_t* dx = nullptr;
  mVideoCodec = nestegg_track_codec_id(mContext, track);
  if (mVideoCodec == NESTEGG_CODEC_VP8) {
    dx = vpx_codec_vp8_dx();
  } else if (mVideoCodec == NESTEGG_CODEC_VP9) {
    dx = vpx_codec_vp9_dx();
  }
  if (!dx || vpx_codec_dec_init(&mVP8, dx, nullptr, 0)) {
    Cleanup();
    return NS_ERROR_FAILURE;
  }

Please also rename WebMReader::mVP8 to mVPX.
Attachment #8341614 - Flags: review?(cpearce) → feedback+
Attachment #8341614 - Attachment is obsolete: true
Attachment #8342033 - Flags: review?(kinetik)
Attachment #8342033 - Flags: review?(kinetik) → review+
Blocks: 947160
Depends on: 947325
https://hg.mozilla.org/mozilla-central/rev/e070e04b0795
Assignee: nobody → j
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Setting relnote? assuming this is on by default for everyone (pending Bug 947325 for Linux).
relnote-firefox: --- → ?
Keywords: feature
Yes, that's correct. Also setting dev-doc-needed for https://developer.mozilla.org/docs/HTML/Supported_media_formats &c.
Keywords: dev-doc-needed
Hi Jan, does this feature require manual QA?

If that is the case, could you please advise on how should I proceed with the validation of this feature? The following aspects would be very useful:
1. Automation coverage for this feature.
2. Things to keep in mind while verifying and performing regression testing.
3. Anything else you think that might help me verify this feature.
Flags: needinfo?(j)
Blocks: 949525
(In reply to Andrei Vaida, QA [:AndreiVaida] from comment #18)
> Hi Jan, does this feature require manual QA?
> 
> If that is the case, could you please advise on how should I proceed with
> the validation of this feature? The following aspects would be very useful:
> 1. Automation coverage for this feature.
> 2. Things to keep in mind while verifying and performing regression testing.
> 3. Anything else you think that might help me verify this feature.

(a) Adding Automated testing is tracked in Bug 949525
(b) Manual verification can be done i.e. with content/media/test/vp9.webm
    to verify visually that it plays back correctly. (once Bug 949525 is fixed)
Flags: needinfo?(j)
Thank you Jan. I was able to successfully verify this feature using the latest Aurora (BuildID: 20131213004002) on Windows 7 x64, Mac OS X 10.9 and Ubuntu 13.10 x64, with the files "vp9cake.webm" and "vp9.webm" from Bug 949525.

Also, I'm not sure if the following notes are relevant at this point, but I thought they were worth mentioning:
- Google Chrome cannot playback the two *.webm files attached to Bug 949525.
- http://www.youtube.com/html5 states that the latest Aurora does not support "MSE & WebM VP9".

I will test this feature further when additional test files will be available.
QA Contact: andrei.vaida
(In reply to Andrei Vaida, QA [:AndreiVaida] from comment #20)
> - Google Chrome cannot playback the two *.webm files attached to Bug 949525.
This is due to the opus audio track.
Opus Support is Chrome currently broken: https://code.google.com/p/chromium/issues/detail?id=104241

> - http://www.youtube.com/html5 states that the latest Aurora does not
> support "MSE & WebM VP9".
For MSE support, check Bug 881512
Jan, I noticed that all the VP9-encoded test files previously attached to Bug 949525 are currently marked as obsolete. Are there any new video samples available for testing purposes? Or maybe a page featuring an embedded video of the same format?
Flags: needinfo?(j)
(In reply to Andrei Vaida, QA [:AndreiVaida] from comment #23)
> Jan, I noticed that all the VP9-encoded test files previously attached to
> Bug 949525 are currently marked as obsolete. Are there any new video samples
> available for testing purposes? Or maybe a page featuring an embedded video
> of the same format?

http://base-n.de/webm/VP9%20Sample.html
(In reply to Andrei Vaida, QA [:AndreiVaida] from comment #23)
> Jan, I noticed that all the VP9-encoded test files previously attached to
> Bug 949525 are currently marked as obsolete. Are there any new video samples
> available for testing purposes? Or maybe a page featuring an embedded video
> of the same format?

The files attached to Bug 949525 are still good test files,
they are part of the automated test suite and only marked
as obsolete since they where included in the patch that got committed: https://bugzilla.mozilla.org/show_bug.cgi?id=949525#c10
Flags: needinfo?(j)
Blocks: 962560
(In reply to Alex Xu from comment #24)
> http://base-n.de/webm/VP9%20Sample.html

Thanks Alex!

(In reply to Jan Gerber from comment #25)
> (In reply to Andrei Vaida, QA [:AndreiVaida] from comment #23)
> The files attached to Bug 949525 are still good test files,
> they are part of the automated test suite and only marked
> as obsolete since they where included in the patch that got committed:
> https://bugzilla.mozilla.org/show_bug.cgi?id=949525#c10

Hi Jan, thank you for clarifying this.
Flags: sec-review?(cdiehl)
Whiteboard: [fuzzing:queue:rforbes]
The feature was thoroughly tested and all the associated test cases were successfully executed, uncovering minor issues only. 

The latest smoke tests performed on Firefox 28 Beta 1 also uncovered no major issues.
Blocks: 968809
Status: RESOLVED → VERIFIED
Adding in-testsuite+ since this is covered automatically by
content/media/test/can_play_type_webm.js
content/media/test/manifest.js
content/media/test/mochitest.ini
content/media/test/vp9.webm
content/media/test/vp9cake.webm

tracked in bug 949525.
Flags: in-testsuite+
Jan, I was running some smoke tests on this feature to make sure that everything is working as expected before its release, when I stumbled over the following error that's being thrown in the Browser Console of both latest Aurora (Build ID: 20140306004001) [1] and latest Nightly (Build ID: 20140305170806) [2]:

(Browser Console error)
> Media resource https://moztrap.mozilla.org/media/attachments/2014/01/22/vp9cake.webm 
> could not be decoded.
The latest Beta (Build ID: 20140303165517) [3] seems to be running the vp9-encoded video sample from that URL [4].


[1] Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0
[2] Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:30.0) Gecko/20100101 Firefox/30.0
[3] Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0
[4] https://moztrap.mozilla.org/media/attachments/2014/01/22/vp9cake.webm
Flags: needinfo?(j)
https://moztrap.mozilla.org/media/attachments/2014/01/22/vp9cake.webm
is not the version that is checked into hg content/media/test/vp9cake.webm

My guess would be that you are not testing with the latest version of vp9cake.webm.
An earlier version was in fact invalid and is explicitly not support anymore (Bug 951770)

I am able to play the version that is in mozilla-central:

 http://hg.mozilla.org/mozilla-central/raw-file/d2dac18d0562/content/media/test/vp9cake.webm
Flags: needinfo?(j)
Yes, confirmed. the version moztrap is serving has incorrect opus headers and is correctly rejected by aurora and nightly.
Jan, Ralph - thank you for clarifying this, I was indeed accidentally running an outdated version of vp9cake.webm.
It's not normal that after disabling "media.webm.enabled" and "media.encoder.webm.enabled" youtube shows that MSE & WebM VP9 is supported and videos start to play in webm/VP9 format, right?

("WebM VP8" is shown to be not supported)
(In reply to avada from comment #33)
> It's not normal that after disabling "media.webm.enabled" and
> "media.encoder.webm.enabled" youtube shows that MSE & WebM VP9 is supported
> and videos start to play in webm/VP9 format, right?

Try setting media.mediasource.enabled to false.
(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #34)

> Try setting media.mediasource.enabled to false.

But what if I only want to disable VP9. Which is a valid reason because it has exorbitant CPU usage and no hardware acceleration, and as such is unplayable.
Disabling whole webm is already a sacrifice, but not a great one since youtube (the de facto web video site) mostly moved to VP9.
But if I disable MSE too I loose most of the higher resolution/quality videos.

(Ignoring the fact that for now since bug 1027875 landed both vp9 and AVC youtube videos play without audio and only for 32 seconds.)
(In reply to avada from comment #33)
> It's not normal that after disabling "media.webm.enabled" and
> "media.encoder.webm.enabled" youtube shows that MSE & WebM VP9 is supported
> and videos start to play in webm/VP9 format, right?

That does sounds like an oversight. If you'd like it to apply both (or have separate prefs for each codec) please file a new bug. That's easier to track than followup on old, fixed bugs.
(In reply to avada from comment #35)
> But what if I only want to disable VP9. Which is a valid reason because it
> has exorbitant CPU usage and no hardware acceleration, and as such is
> unplayable.
> Disabling whole webm is already a sacrifice, but not a great one since
> youtube (the de facto web video site) mostly moved to VP9.
> But if I disable MSE too I loose most of the higher resolution/quality
> videos.

MP4 does not work with MSE yet so you should disable MSE if you don't want WebM.
(In reply to Ralph Giles (:rillian) from comment #36)
> That does sounds like an oversight. If you'd like it to apply both (or have
> separate prefs for each codec) please file a new bug. That's easier to track
> than followup on old, fixed bugs.

Bug 1035622 now covers this.(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #37)
Turning off MSE is wise. None of it works well at the moment.
Any idea, what I still only get VP8 videos with FF36 on youtube limited to 360p, while Chrome receives VP9 streams with up to 1080p?

Also on youtube.com/html5 I get "MSE & WebM VP9" = disabled.
(In reply to Clemens Eisserer from comment #41)
> Any idea, what I still only get VP8 videos with FF36 on youtube limited to
> 360p, while Chrome receives VP9 streams with up to 1080p?
> 
> Also on youtube.com/html5 I get "MSE & WebM VP9" = disabled.

The place for support is support.mozilla.org
Anyway, because it's disabled, because it's not fully enable implemented.media.mediasource.enabled in about:config. Then you'll get all resolutions.
(In reply to avada from comment #42)
> The place for support is support.mozilla.org
> Anyway, because it's disabled, because it's not fully enable
> implemented.media.mediasource.enabled in about:config. Then you'll get all
> resolutions.

Well this got effed... Supposed to be "enable media.mediasource.enabled"
MSE is not supported in Firefox 36. MSE support for MP4 is enabled 37 beta for Mac and Windows Vista and up.
Will MSE für VP9 be enabled anytime soon on Linux?
(In reply to Clemens Eisserer from comment #45)
> Will MSE für VP9 be enabled anytime soon on Linux?

Not soon.
Hmm, even with enable media.mediasource.enabled, VP9 playback on Youtube has all kinds of issues on Linux.
Unfortunately it seems, Firefox is not a good choice for youtube.com-users running Linux currently :/
(In reply to Clemens Eisserer from comment #47)
> Unfortunately it seems, Firefox is not a good choice for youtube.com-users
> running Linux currently :/

I just use the HTML5 Video Everywhere addon to force Firefox's built in video player instead of YouTube's crappy one and I've disabled webm and set it to only use mp4. Works fantastically better. YMMV

A new bug for Linux issues should probably be filed instead of commenting here further.
For those wondering how to enable MSE & WebM VP9 in Firefox nightly, you must leave:

media.webm.enabled=true (default)

media.mediasource.enabled=true (default)

You must change:

media.mediasource.webm.enabled=true (user-set)
(In reply to Luke from comment #49)
> For those wondering how to enable MSE & WebM VP9 in Firefox nightly, you
> must leave:
> 
> media.webm.enabled=true (default)
> 
> media.mediasource.enabled=true (default)
> 
> You must change:
> 
> media.mediasource.webm.enabled=true (user-set)

Same works on Fx37, nightly not required.
Are the directions in #49 platform agnostic? Or are they Windows specific? I want to get this working under Linux.
(In reply to Scott Baker from comment #51)
> Are the directions in #49 platform agnostic? Or are they Windows specific? I
> want to get this working under Linux.

All the webm stuff is generally platform agnostic. The decoder is built-into Firefox. It's just the h.264 & mp3 stuff that's platform dependent.
I should have been more specific. Are the MediaSource options platform agnostic?
(In reply to Scott Baker from comment #53)
> I should have been more specific. Are the MediaSource options platform
> agnostic?

The same prefs need to be set as in comment 49, but one is defaulted to off still. If you turn it all on it should work though. (youtube.com/html5 says "MSE & WebM VP9" is enabled for me, at least)
(In reply to Dave Garrett from comment #54)
> (In reply to Scott Baker from comment #53)
> > I should have been more specific. Are the MediaSource options platform
> > agnostic?
> 
> The same prefs need to be set as in comment 49, but one is defaulted to off
> still. If you turn it all on it should work though. (youtube.com/html5 says
> "MSE & WebM VP9" is enabled for me, at least)

Same here.  Also, if you right click you can click on the video, click on "stats for nerds" and you will see the codec is vp9 (assuming the video exists in vp9).
At least for me, youtube with VP9 doesn't work reliable in Firefox.
From time to time clips don't continue loading and are stuck at e.g. 30%, also when jumping inside a clip it quite often simply does not play any further after some jumps.
(In reply to Clemens Eisserer from comment #56)
> At least for me, youtube with VP9 doesn't work reliable in Firefox.
> From time to time clips don't continue loading and are stuck at e.g. 30%,
> also when jumping inside a clip it quite often simply does not play any
> further after some jumps.

I haven't seen that, yet.  What are your PC specs, out of curiosity?
Mediasource Extensions is very much still a work in progress.
https://bugzilla.mozilla.org/show_bug.cgi?id=778617
(In reply to Clemens Eisserer from comment #56)
> At least for me, youtube with VP9 doesn't work reliable in Firefox.
> From time to time clips don't continue loading and are stuck at e.g. 30%,
> also when jumping inside a clip it quite often simply does not play any
> further after some jumps.

That is why it is disabled in nightly.
something bad about MSE & Webm VP9 is that youtube only delivers VP8 360p :/
so that I need to enforce the Flash Player on Linux to get better quality

Is someone still working on this? (since the last post is from april)
I opened a bug for the specific isse I'm experiencing with MSE & Web VP9 on Fedora 21 with Firefox 38.0.5
(In reply to Djfe from comment #60)
> Is someone still working on this? (since the last post is from april)

This feature is VP9 support in Firefox and is complete hence the closed bug and no further comments in this bug. MSE support is being tracked in bug 778617.
oh I totally forgot to copy&paste the bugzilla link here:
https://bugzilla.mozilla.org/show_bug.cgi?id=1173179

is the description ok?
Depends on: 1175696
Depends on: 1115096
Depends on: 1105293
Chris - I don't think we should be tracking MSE related issues on this bug because they're outside of the scope of what was originally done here.
Blocks: 1175696
No longer depends on: 1175696
Alias: vp9
Flags: sec-review?(cdiehl)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: