{"id":691,"date":"2014-11-25T00:47:50","date_gmt":"2014-11-24T22:47:50","guid":{"rendered":"http:\/\/mattiesworld.gotdns.org\/weblog\/?p=691"},"modified":"2014-11-25T00:56:41","modified_gmt":"2014-11-24T22:56:41","slug":"activating-hw-acceleration-for-embedded-youtube-videos","status":"publish","type":"post","link":"https:\/\/mattiesworld.gotdns.org\/weblog\/2014\/11\/25\/activating-hw-acceleration-for-embedded-youtube-videos\/","title":{"rendered":"Activating HW acceleration for embedded YouTube videos"},"content":{"rendered":"<p>Ever since Google Chrome became terribly slow in gmail, drive, etc regardless of computer or platform, I&#8217;ve picked up Mozilla Firefox again. The switch didn&#8217;t go painless but I really was tired of typing a whole sentence before Chrome would display it. This problem produces itself not only on google sites but actually in about any text box I would type, be it intermittently.<\/p>\n<p>The main issue with switching to Firefox was stuttering video playback. As you may know, chrome bundles its own flash plugin which is actually the same plugin but tweaked to work optimally with chrome (pepper api). At the same time google controls distribution\/patching.\u00a0 So, if google can tweak the plugin for good performance, why can&#8217;t we? \ud83d\ude09<\/p>\n<p>First thing I discovered, is that somehow flash hardware acceleration was disabled. You can enable this by right-clicking on any flash video and click on &#8220;settings&#8221;. In the &#8220;Display&#8221; tab, you can check &#8220;Enable Hardware Acceleration&#8221;.<\/p>\n<p><a href=\"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-content\/uploads\/2014\/11\/yt_enable-flash-HW-accel.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-thumbnail wp-image-692\" src=\"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-content\/uploads\/2014\/11\/yt_enable-flash-HW-accel-150x150.png\" alt=\"flash enable HW acceleration setting\" width=\"150\" height=\"150\" \/><\/a>Smooth youtube vids FTW! Fullscreen video&#8217;s also showed up on the correct monitor now (dual head setup). My joy was only for limited time, as I discovered hardware acceleration dit not work for embedded youtube video&#8217;s. I was happy nevertheless as the bulk of video&#8217;s I watch are on youtube.<\/p>\n<p>However, today, watching the <a title=\"Jolla Tablet\" href=\"http:\/\/jolla.com\/\">Jolla Tablet<\/a> intro movie embedded on the site, I could not help feeling the itch again. Why oh why did this play fluently in chrome but did it suck so hard in firefox? Check out this framerate:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-697\" src=\"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-content\/uploads\/2014\/11\/yt_embedded_noHWaccel1.png\" alt=\"yt_embedded_noHWaccel1\" width=\"414\" height=\"265\" srcset=\"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-content\/uploads\/2014\/11\/yt_embedded_noHWaccel1.png 414w, https:\/\/mattiesworld.gotdns.org\/weblog\/wp-content\/uploads\/2014\/11\/yt_embedded_noHWaccel1-300x192.png 300w\" sizes=\"auto, (max-width: 414px) 100vw, 414px\" \/>I started by creating a virgin system account to avoid having my 7 year old home dir, possibly dragging along some evil deprecated setting, be the culprit. This didn&#8217;t change anything but at least I had both a blank Firefox and Chrome profile to test with.<\/p>\n<p>First I was under the impression that there would have to be a global flash settings file since when right-clicking on the embedded video, it showed the &#8220;Settings&#8221; as <a title=\"flash settings disabled on embedded youtube video\" href=\"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-content\/uploads\/2014\/11\/yt_embedded_noHWaccel2-flash-settings-disabled.png\">disabled<\/a>. There does indeed exist such file: <a title=\"browser plugins on Arch wiki\" href=\"https:\/\/wiki.archlinux.org\/index.php\/browser_plugins#Configuration\">\/etc\/adobe\/mms.cfg<\/a> in which you can put &#8220;EnableLinuxHWVideoDecode=1&#8221;. This only crashed my firefox. I did install an additional vdpau package but it didn&#8217;t matter. Also, looking at the &#8220;Nerd stats&#8221; (right-click on video), I learned even youtube vids didn&#8217;t have hardware accelerated decoding, only accelerated rendering. So I didn&#8217;t proceed on this path.<\/p>\n<p>Now let&#8217;s check out how chrome is doing it. Pulling up the &#8220;Nerd stats&#8221; did surprise me: chrome does not use flash by default for embedded video&#8217;s, it uses WebM\/VP9!<\/p>\n<p><a href=\"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-content\/uploads\/2014\/11\/yt_embedded_chrome_vp91.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-700 size-thumbnail\" src=\"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-content\/uploads\/2014\/11\/yt_embedded_chrome_vp91-150x150.png\" alt=\"\" width=\"150\" height=\"150\" \/><\/a>This begs the question: how is Firefox&#8217;s WebM support? Turns out it&#8217;s no problem, just change your <a title=\"Youtube html5 setting\" href=\"https:\/\/www.youtube.com\/html5\">youtube html5 setting<\/a> from &#8220;default player&#8221; (=flash) to &#8220;html5&#8221;.<\/p>\n<p><a href=\"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-content\/uploads\/2014\/11\/yt_html5_settings1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-696 size-large\" src=\"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-content\/uploads\/2014\/11\/yt_html5_settings1-1024x640.png\" alt=\"youtube html5 settings\" width=\"584\" height=\"365\" srcset=\"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-content\/uploads\/2014\/11\/yt_html5_settings1-1024x640.png 1024w, https:\/\/mattiesworld.gotdns.org\/weblog\/wp-content\/uploads\/2014\/11\/yt_html5_settings1-300x187.png 300w, https:\/\/mattiesworld.gotdns.org\/weblog\/wp-content\/uploads\/2014\/11\/yt_html5_settings1-480x300.png 480w, https:\/\/mattiesworld.gotdns.org\/weblog\/wp-content\/uploads\/2014\/11\/yt_html5_settings1.png 1680w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a>So the\u00a0 chrome pepper flash tweak actually came down on not using flash. \ud83d\ude42 Youtube does this by default on chrome but not on firefox. <a title=\"Image by MacGasm.net\" href=\"http:\/\/www.macgasm.net\/wp-content\/uploads\/2011\/06\/Dr_Evil-google.jpg\">Naughty Google<\/a>!<\/p>\n<p>You may notice that Firefox does not support all youtube hmtl5 features yet. In particular, you will be served VP8 video&#8217;s instead of VP9 which may make a difference in the available resolutions. However, Media Source Extensions and WebM VP9 <em>can<\/em> already be activated by setting:<\/p>\n<pre>media.mediasource.enabled = true<\/pre>\n<p>in about:config. Experimental h264 support can be activated with:<\/p>\n<pre>media.mediasource.ignore_codecs = true<\/pre>\n<p>You can track the MSE support in firefox in <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=778617\">this bug report<\/a>.<\/p>\n<p>Itch scratched and fixed. Finally \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever since Google Chrome became terribly slow in gmail, drive, etc regardless of computer or platform, I&#8217;ve picked up Mozilla Firefox again. The switch didn&#8217;t go painless but I really was tired of typing a whole sentence before Chrome would display it. This problem produces itself not only on google sites but actually in about &hellip; <a href=\"https:\/\/mattiesworld.gotdns.org\/weblog\/2014\/11\/25\/activating-hw-acceleration-for-embedded-youtube-videos\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Activating HW acceleration for embedded YouTube videos<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,4,6,10,2],"tags":[],"class_list":["post-691","post","type-post","status-publish","format-standard","hentry","category-hardware","category-linux","category-software","category-tweaking","category-web"],"_links":{"self":[{"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/posts\/691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/comments?post=691"}],"version-history":[{"count":5,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/posts\/691\/revisions"}],"predecessor-version":[{"id":702,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/posts\/691\/revisions\/702"}],"wp:attachment":[{"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/media?parent=691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/categories?post=691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mattiesworld.gotdns.org\/weblog\/wp-json\/wp\/v2\/tags?post=691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}