How to enable MSE & H.264 support on YouTube for Firefox right now
Update: Firefox supports all HTML5 media features that YouTube requires. When you open the HTML5 test page you will notice that all options are checked indicating that they are all supported. Note that some Linux distributions may lack support for some features. End
When you open YouTube's HTML5 page in the most recent stable version of Firefox right now, you will notice that support is not available for all technologies listed on the page.
Support may be available for HTMLVideoElement, H.264 and WebM VP8, but not for Media Source Extensions, MSE & H.264 or MSE & WebM VP9.
A configuration option is available to enable Media Source Extensions and MSE & WebM VP9 right now in the Firefox browser.
To do so, load about:config in the browser's address bar and search for the term media.mediasource.enabled there. Double-click the preference to set it to true if it is not set to true already.
Then, search for media.mediasource.webm.enabled afterwards and make sure it is set to true as well. If it is not, double-click on it to switch its value to true.
When you go back to YouTube's HMTL5 page afterwards, you will notice that only MSE & H.264 is listed as unsupported while all remaining options are supported.
If you do not do that, you will only receive select resolutions for videos on YouTube when using the HTML5 video player. This is quite problematic as Google will force Firefox users to use the HTML5 video player from Firefox 33 on.
Mozilla has not enabled the feature by default yet, not even in the most recent Nightly version of Firefox. This is an indicator that the feature is not yet ready for prime time and that it may take a couple of release cycles before it will be enabled by default.
Most video resolutions become available after you enable Media Source Extensions in Firefox. What is still not supported afterwards however is MSE & H.264 which means that some videos may not play in all resolutions yet on the site.
Enable MSE & H.264
A new preference in Firefox Nightly 34 changes that however, so that support for all requested technologies is provided afterwards on YouTube.
Note: While the article concentrates on Google's video hosting platform, enabling support for MSE & H.264 will benefit users of the browser on other websites as well.
You need to create a new preference to do so:
- Type about:config and hit enter.
- Confirm you will be careful.
- Right-click and select New > Boolean.
- Name the preference media.mediasource.ignore_codecs.
- Set its value to True.
Update: Linux userrs may change the following preferences as well:
- media.mediasource.mp4.enabled to true
- media.fragmented-mp4.* to true
- media.fragmented-mp4.use-blank-decoder to false
If you go back to YouTube's HTML page, you should see all six technologies listed as supported (in green).
Several bugs need to be resolved before the feature will be enabled directly by Mozilla for all users of the browser. You can check out the mediasource progress here.
This means that you may get hangs or experience other issues after enabling mp4 container support for Media Source Extensions in the browser.
Still, it is great to see that Mozilla is working on support for the feature in Firefox. It is unclear if it will manage to resolve all issues before Firefox 33 gets released, as it may result in an increase in support requests when Firefox users notice that YouTube is serving them only some resolutions.
Right now best way to see videos on Youtube: IE11 and go to Safety-> ActiveX Filtering and enable it. It will play ALL videos on mp.4 format with DASH enabled, 1080p support and all. The most efficient way.
IE, are you crazy?
Software has no opinion. Only people do. Such as yours.
install user agent switcher and set it to IE 11
Thank you man, you really helped me out with that hint.
Actually in my case it’s a problem with playing videos on YouPorn (and it’s partner sites) I have trouble with for the last couple of months (I don’t remember when this first came up). lol…
The video starts playing fine, but this lasts only for a couple of minutes. Then the video just stops (sometimes just the video track, while the audio proceeds playing), also the minute counter keeps it’s value.
At some point, a couple of minutes before video ends, it starts playing fine again. It’s a strange behaviour, in addition seeking does not work.
I’m running Firefox ESR 38.7.1 on Windows 7. No Flash installed, so just HTML5 is used.
And there was a time in the past where the videos played flawlessly on that system.
So I tried enabling the media.mediasource.webm.enabled flag, explained above, but this didn’t change anything.
For me it never came to mind trying Internet Explorer 11. … Just did this –> no issue there.
So as a workaround I decided to (temporarily) change my user agent in Firefox to that one that IE11 uses.
Works like a charm!
Running Aurora on Windows XP, I still don’t have the Cisco h.264 codec. Any way to enable that?
Not yet, it appears to be only available in Nightly right now.
MSE on YouTube still doesn’t work properly. Seeking sometimes takes a lot of time, seeking back doesn’t work at all and repeat also doesn’t work. Just because you can flip the switch doesn’t mean you’re going to get MSE & H.264 support because according to a Mozilla developer, MP4 (H.264, etc.) aren’t supported in MSE yet. They are concentrating on Webm on YouTube right now.
Relevant bugs: https://bugzilla.mozilla.org/show_bug.cgi?id=881512, https://bugzilla.mozilla.org/show_bug.cgi?id=1024858
My advice, don’t force enable MSE for now unless you want a lot of YouTube headaches. ;)
No thanks I’ll still use flash untill it really dies,my motto if it works don’t mess with it!I’ll force flash player with Youtube Center if I have to!
I did that and lost sound on youtube videos …. No thanks
i lost sound too. how to fix it?
I’ve done this under Firefox 32.02, but MSE & H.264 is still signed red.
Don’t know why this works for the author…
It’s the same for me under Ubuntu
The CISCO h.264 codec is in my plugin list now.
I’ve added the media.mediasource.ignore_codecs true boolean
On this page: https://www.youtube.com/html5
only HTMLVideoElement and WebM VP8 are available.
So I’ve got a CISCO h.264 codec, the Flash plugin would have h.264 support, but YouTube thinks I can’t play h.264 videos. WTF? :)
I’m keen to get rid of the crappy Flash plugin if I can finally use the HTML video tag with the CISCO h.264 codec.
The Cisco plugin is currently only being used for WebRTC as far as I know.
Ah nuts. Flipping Mozilla sure know how to make life hard on their users!
Worked 1 time before something disabled it again. F it back to Opera 36
MSE works fine as far as I can tell. But I can see why they hid “ignore_codecs” from the config page. 1080p playback just stops playing randomly, and 720p keeps glitching, freezing, and occasionally the audio stops working. Hope Mozilla can sort this out soon as I really want to play 60fps in Firefox. For now I have to use ‘youtube-dl -g’ to grab the URLs for 60fps streams so I can watch them in VLC, or open Chrome.
Firefox Developer Edition 35.0a2 (2014-11-14)
EDIT: Slight correction. With MSE enabled, some 60fps videos do work with FF as they have WEBM 60fps streams, but playback is sporadic/laggy and not very watchable. Chrome plays the same videos fine at 60fps so it’s not my PC’s fault.
Thank you :)
Do not add the value to ignore codecs in “about:config”. You’ll lose sound in Youtube-Videos !
Running FF 35.01 in Windows 7 and MSE still doesn’t work properly. Sound is sometimes lost and seeking back does not work, so no change from earlier, although Mozilla claims most of the bugs fixed now. Perhaps the nightly builds would work.
Enabling MSE also causes Youtube to offer VP9 streams to FF by default, which means that you will lose hardware acceleration with most GPUs. That happens even with “ignore_codecs” enabled. With a modern CPU that is not a problem, but it certainly is on my secondary system with an older processor. 720p is choppy and 1080p is a slide show.
MSE is working near flawlessly in FF37, so it’ll trickle down soon. I have none of the issues you mention in the latest DE build.
PS: You can disable WebM support by disabling the following flag: “media.mediasource.webm.enabled”
Thanks for your answer. Good to know that it’s improving. Do you know if they are going to enable MSE by default in FF37?
Seems the plan is to have MSE enabled in FF36, but limited to Youtube and only Windows 7+(maybe Mac as well). It seems they are still having issues with MSE+MP4 on Linux, and MSE+WEBM still isn’t completely ready. Seems full MSE support will hit in FF37, but EME doesn’t seem ready yet so support for services like Netflix will likely still be awhile.
NOTE: This is what I’ve gathered by reading the Bug Tracker, but there are hundreds of different bugs and issues being tracked related to MSE and EME making it hard to be sure, so things could always be delayed.
I’m missing something here about the youtube html page.
I’ve managed since taking the screenshot to to enable the MSE & WebM VP9 after finding an older post of yours.
However The remaining two H.264 and MSE & H.264 still have the red exclamation marks.
Any advice appreciated,
Which operating system are you using?
Sorry for the delay
Current OS = Windows 10 Pro.
I think when I first posted it was Windows 8.1 Pro – but the youtube html page still shows the same information as in the originally posted screenshot.
I thought, I’ll post my frankenstein-solution for smooth 1080p videos @60FPS at Youtube here:
Clean Profile: Yes
Used OpenH264 Version: 1.3
8GB DDR2 RAM
Club3D 7870 JokerCard
Following settings are changed for it:
Tested video: https://www.youtube.com/watch?v=mii5yODkVa
Yes, “MMSE & WebM VP9” won’t get enabled, but doesn’t really matter in this case.
This doesn’t work anymore. media.mediasource.enabled is already true in 37.0.2, and adding ignore_codecs does nothing.
Youtube only offers 360p as an option.
MSE is enabled by default in FF37. Youtube videos should play with DASH support now. If they aren’t for you try making sure “media.mediasource.mp4.enabled” and “media.mediasource.webm.enabled” are both set to true. Also make sure “media.mediasource.whitelist” is set to false if you want to use non-Youtube sites with MSE, though it should already be disabled in FF37.
If you are still having issues, what OS are you running? Are all of the boxes checked on http://youtube.com/html5 ?
Setting “media.mediasource.webm.enabled” to true fixed it. Thank you!
MSE & H.264 and H.264 are red, but I can choose the quality now.
Excellent addition to the tutorial, this fixed my last issue on getting “MSE & WebM VP9” checked of the list of supported features. I’m running a stable build (40.0.3) on Fedora 22.
Sounds like there is something wrong with MSE MP4 support for you then. Are you running Mac or Linux? That could be part of the reason.
EDIT: I just fixed it by setting “media.fragmented-mp4.enabled” to true. I’m using Windows 7, but this was in your Linux only users section.
Now everything on the youtube HTML5 page is ticked.
I followed the instructions, and nothing changed. :/
Me too, I am on Linux and I followed the instructions but absolutely nothing has changed.
Firefox 40.0.3 on Win XP SP3: All is red on Youtube html5 test page, ie does not work.
Intel Graphics GMA500 “Poulsbo”: Hardware acceleration on.
CCCP installed and configured with both filters (MPEG4 Video (H264) 720×576 plays fine in mpc)
Firefox: media.directshow.enabled;true && media.hardware-video-decoding.enabled;true && media.mediasource.mp4.enabled;true && media.fragmented-mp4.enabled;true && media.mediasource.webm.enabled
Looks like there’s no H264 support in Windows XP. That’s what is said in these places:
Thanks for this!
You SHOULD NOT set the “media.fragmented-mp4.gmp.enabled” pref to true. This pref is for developer testing only. With this pref enabled, Firefox will try to decode YouTube video using the Cisco OpenH264 codec. YouTube serves H.264 High Profile video, but OpenH264 can only decode H.264 Baseline Profile. OpenH264 is only intended for use with WebRTC video chat, for now.
Thank You Very Much. After following this post, html5 on youtube worked fine for a while. Around firefox 42 it stopped and would revert to using flash. Finally thought to check this post for anything new. Luckily found this comment. After changing back ‘media.fragmented-mp4.gmp.enabled’ to false. And html5 on youtube works again. Also made sure to set ‘media.fragmented-mp4.* to use firefox 43 defaults.
While was in ‘about:config’, also made sure the rest that was suggested in this post was not causing any other issues. Looks that they are not as what is suggested here is default in firefox 43. Oh, this on Linux BTW.
Chris, Thank You Very Much. Youtube works with html5 again :)
doesnt not exist.
This worked on Debian until an update that morning, every variables are still true but the second line of functionalities on https://www.youtube.com/html5 are red now. I have upgraded all packages, nothing changed. I can watch videos with HTML5 player but not in Full HD and 30FPS only.
You can also enable this on Windows XP now:
I will never understand why Mozilla blacklisted a GTX650, sicnce I am able to watch 4k 100Mbps with 5% CPU in full screen, instead in Firefox I am unable to watch a simply html5 240p.
Using Firefox 49.0.1 now on Windows 10 and I have the first two columns ticked, but not “WebM VP8” or “MSE and WebM VP9”. I’d like to see all 6 boxes ticked though I’m not sure I can explain why :)
Martin, this article is very cool but probably dated now. Recent articles like the h264ify article were good. Perhaps it would be helpful to update this article though?
Keep up the great work. Ghacks is one of the most useful sites on the net from my PoV.
I just checked Fx49 on two Windows machines and they have all boxed ticked on YouTube without me modifying preferences at all. Which version and OS are you running? Can you check and see what is listed under plugins?
My comment says Windows 10 :) Strictly “Windows 10 Enterprise 2015 LTSB”. Unsure if there’s a way to get a more exact version string in Windows 10?
As for Firefox, it’s 49.0.1, x64, Build 20160922113459, release channel.
Only plugin installed is:
OpenH264 Video Codec provided by Cisco Systems, Inc.
which is exactly how I like it :)
NPAPI plugins BLOW! :)
about:config prefs that may be related:
Also, I’ve unticked “Play DRM content” under Tools > Options > Content
This is rather strange. I have the same configuration and all boxes are ticked on YouTube in the same browser on the same OS. Do you have any add-on installed that might interfere with this? Could you try and check the page with Firefox’s Safe Mode enabled? Hold down Shift-key while you start Firefox.
i have to uncheck (set to false)
on my core i5 notebook, otherwise youtube seems to use webm always and then there is no hw accel.
i can play @2160p with only ~10% CPU, with mediasource.webm enabled it’s going at 80% and stuttering all the time.
Have you tried h264ify ?
thanks, yes, in the meantime i did, that works too.
btw, upcoming firefox releases do perform a lot better on webm changelog for v51
Improved video performance for users without GPU acceleration:
– Less CPU Usage
– Better full screen experience
on my system there really is a big difference.
Excellent news. Maybe those boys in Kiwi land who AFAIK did significant video work are at it again. Excellent.
Hi, on my OS I am able to watch 4k up to 120Mbps. What to do the see a simply 240p on Facebook without hang in Firefox? thanks. On Firefox I can watch videos only via Flash Player.
Well, now i can’t watch any videos.
Thanks for fucking my YouTube experience up.