
VP9: Faster, better, buffer-free YouTube videos - jplevine
http://youtube-eng.blogspot.com/2015/04/vp9-faster-better-buffer-free-youtube.html
======
SoapSeller
The missing phrase in the post is "hardware acceleration", which is is
completely broken for VP8/9(In Firefox & Chrome, IE&Safari doesn't support
either).

I'm using an extension[0] to force youtube to serve me with h264 in order to
be able to watch 4K videos & maintain reasonable battery life.

[0]
[https://github.com/erkserkserks/h264ify](https://github.com/erkserkserks/h264ify)

~~~
nfriedly
Yea, but the flip side of that is that hardware acceleration is a chicken-and-
egg problem: Google's work here makes it more likely that we'll get hardware
acceleration working in the future because there will now be a good reason to
do it.

(They do mention "More than 20 device partners across the industry are
launching products in 2015 and beyond using VP9.", so perhaps some of those
will feature working hardware acceleration.)

~~~
aroch
Both Intel (integrated GPUs) and nVidia (discrete GPUs) have announced VP9 hw
acceleration for their GPUs. However, I believe these are probably the only
two "household name" ODMs that are supporting it. The rest of the partners are
cheap SOC manufacturers like Rockchip and Mediatek

~~~
pseudosavant
FWIW, everyone and their dog (nVidia, AMD, ARM, Qualcomm, etc) announced
support for VP8 when WebM launched in 2010 too
([http://blog.webmproject.org/2010/05/introducing-webm-open-
we...](http://blog.webmproject.org/2010/05/introducing-webm-open-web-media-
project.html)). Yet, hardware accelerated decode is basically non-existant
still, and accelerated encoding doesn't exist at all. Even though lots of
companies did demos of hardware acceleration.

Part of the problem is that within 3 years Google had already basically
dropped VP8 and moved onto VP9. That kind of churn doesn't go over well in the
hardware space typically. For a variety of practical reasons, codecs aren't
the type of thing you usually replace every few years. It takes more than a
few years for really good quality optimized encoders (e.g. x264, LAME, etc) to
be built.

~~~
threeseed
This why everyone should be skeptical about Google's foray into mobile video
codecs. They have no "skin in the game". This isn't their core business like
companies such as Sony or Adobe. And we all know what happens to Google's non
core business products.

~~~
madeofpalk
Did you forget about Android? That's a pretty significant amount of... skin.

~~~
taf2
Do they actually have a good way to monetize android - are they selling
phones? Last I checked they had a great search engine. How does the revenue
model on mobile compare? Android is different on every oem so though it might
be huge - is it really even a google product or more of a Google open source
project?

~~~
danieldk
_Do they actually have a good way to monetize android_

As far as I understand, the initial motivation is to avoid being locked out.
Suppose that iOS held 80% of the market, they could change the default engine,
replace Google Maps with Apple Maps (like they did), etc. Given that
smartphones and tablets are now commonly used to access the web, Google could
have lost a serious chunk of traffic.

In other words, Google does not have to monetize Android directly, it exists
to keep people in Google's ecosystem.

------
_jomo
I'm not sure how YouTube estimates the proper video quality for your internet
connection, but they're definitely doing it wrong. I have a 150 Mbps
connection and I can watch Full HD videos without buffering. This was already
the case on my old 16k connection but in both cases YouTube defaults to 480p.
This is really annoying and I always end up setting it to the highest quality.

Another problem seems to be YouTube's player that just sometimes stops to play
although the video is completely loaded, or you try to skip or go back a few
seconds and it just stucks completely.

Luckily I found this Firefox extension that just uses the native player and
allows me to use high quality by default:

[https://github.com/lejenome/html5-video-
everywhere](https://github.com/lejenome/html5-video-everywhere)

~~~
Sargos
It starts at 480p but quickly ramps up. Netflix works the same way. Start
quickly and ramp up quality until the connection can't support any higher.

Try letting it play for a bit and you'll notice everything get sharper.
Especially in full screen.

~~~
vitd
I find this to be a worse user experience. I would rather wait the 5-10
seconds for the high quality stream to buffer than have every video look
really crappy for the first minute, then slowly get better. I guess I'd prefer
a consistent experience overall. I stopped watching Netflix on my TiVo and
switched to only watching it on my AppleTV because of issues like this.

~~~
AceJohnny2
You're in the minority: [https://gigaom.com/2012/11/09/online-viewers-start-
leaving-i...](https://gigaom.com/2012/11/09/online-viewers-start-leaving-if-
video-doesnt-play-in-2-seconds-says-study/)

~~~
fulafel
The results of this study can be explained by 2 plausible hypotheses:

* Users have been trained to expect that if a random site spins the beach ball for a few seconds it's unlikely to get better. Akamai customers are a mixed set of smaller web sites, and these often have an "eternal progress meter" as failure mode of video players.

* Viewers in the Akamai mix are impatient because content includes a lot of emailed links, and ancillary (eg news article related) content

Neither of these would apply to Netflix and Youtube

------
gergles
Too bad they can't get rid of DASH, because DASH is the real problem behind
buffering, jerky playback and other nonsense. I really strongly dislike how
bad the video playback experience is and has been for quite some time on
YouTube.

~~~
higherpurpose
I agree it's annoying. In its effort to save _seconds_ of bandwidth from each
video, Google has made everyone's Youtube experience worse.

Fine, don't load the _whole_ video ahead of time, but can you just load the
first say 30 seconds? Or maybe even - and I know this is going to sound crazy
- a _whole minute_ ahead of time?

I remember a time when it seemingly didn't load even 5 seconds ahead of time.
That's just ridiculous. Fire the bean counters who are in charge of that
short-sighted idea.

~~~
anon4
I remember a time when the flash player loaded the entire video to a temp file
and you could just go through /proc/$firefox-pid/fds, find it and dump the
video that way.

~~~
teach
Pretty sure I still have a bash script laying around to automate this process.

------
Sir_Cmpwn
If it interests anyone here, I have written a Firefox extension that forces
YouTube videos to play in an external video player (mpv in my case). You can
get it here (only for Linux):

[https://github.com/SirCmpwn/ExternalPlayer](https://github.com/SirCmpwn/ExternalPlayer)

I got fed up with the YouTube player and wrote this in an afternoon instead.

~~~
rasz_pl
HA, I did similar thing for Opera 12.xx on windows with mplayer :-)

I see you are using youtube-dl. I did too at first, but quickly swapped for
YouTubeCenter plugin - it extracts link to mp4 directly in the javascript, my
additional javascript grabs that and substitutes YT player window with big
PLAY button with a link to custom protocol "magnet1:[https://r2---
sn-2apm-f5fee.googlevideo.com/videoplayback?sou...](https://r2---
sn-2apm-f5fee.googlevideo.com/videoplayback?source=youtu....blablabla").

Copying the way browsers open magnet links was the quickest and easiest way I
found of passing links directly to a third party program. I simply made a new
one, called it magnet1, and directed it towards
\AppData\Roaming\smplayer\mplayer.bat %1

.

mplayer.bat:

echo off

set var=%1

start "" "C:\Users\bofh\AppData\Roaming\smplayer\smplayer" "%var:~9%

exit

.

cut first 9 characters (magnet1:) and run mplayer, that again was the only way
I found of starting new program without keeping command line window open. No
delay between clicking and starting video, no unnecesary command prompt window
with youtube-dl running. I also have a second custom protocol that starts yet
another bat file sending link directly to my TV - one click on a page and YT
clip starts playing on the TV in the next room :o)

Feels like duct tape and glue, but works flawlessly :)

[https://github.com/YePpHa/YouTubeCenter](https://github.com/YePpHa/YouTubeCenter)

~~~
Sir_Cmpwn
I was using youtube-dl, but no longer. Now I just pass the URL directly into
mpv, which has its own youtube-dl hook.

Side note, oh boy do you need to get some Linux in your life. That's the
hackiest thing I've ever seen on Windows for something that'd take minutes to
implement on Linux.

~~~
rasz_pl
That still takes time to refetch yt page and parse for mp4 link. Smplayer can
do it too, but it takes ~1 second, thats ~1 second too long for me :P. If I
wasnt so lazy I would find youtubecenter code responsible for this parsing,
but I am, so I simply

document.getElementById("watch8-ytcenter-
buttons").children[0].children[0].href

and bam, mp4 link ready in javascript for free.

Got plenty of Linux in my life (mostly embedded, for example running my DIY TV
build from recycled 32' LCD panel, universal chinese lcd controller and
rasPee. Yes, I like repurposing junk). Linux is how I learned to cobble up
together ugliest hacks imaginable.

------
megaman821
Watching YouTube using Chrome on Windows is the double battery killer. Chrome
doesn't let Windows go into low power states and YouTube is serving up video
that can't be hardware decoded.

------
mrinterweb
I am pretty sure that Firefox 28 added VP9. It just seems odd that in the
"Where can I use VP9?" section, that Firefox and Opera where not mentioned.

Edit: I just noticed that Firefox is currently using Flash on Youtube for
video playback. The video referenced in the article:
[https://www.youtube.com/watch?v=pwnefUaKCbc](https://www.youtube.com/watch?v=pwnefUaKCbc)

~~~
0x006A
Firefox supports VP9 but currently does not enable VP9 with
MediaSourceExtensions (MSE) by default. You can enable the current
implementation via a flag set media.mediasource.webm.enabled to true in
about:config

Youtube only used VP9 with MSE but even then not all content is available as
VP9, some is only available as H.264/MSE.

You can check [https://www.youtube.com/html5](https://www.youtube.com/html5)
to see what your browser supports.

~~~
piyush_soni
Thanks. I did all of that, and I can see that all the formats are checked in
my Firefox now. The only question now I have is, how do I know which of these
formats is my YouTube video currently playing in? (It does show the HTML5
player now).

~~~
mkagenius
Right click on video --> stats for nerds --> MimeType will show codecs as vp9.

offtopic: I could see download rate at 9363 Kbps (or nearly 1.2 MBPS) for a
1080p video, which looks like pretty good compression to me.

~~~
edwintorok
FWIW after enabling MSE, playing a 4k video, and opening 'stats for nerds' and
switching away and back to firefox (Iceweasel 31.6.0) on Debian jessie the
browser locks up at 100% cpu usage.

------
kudu
This still doesn't do anything about YouTube's horrible bitrate settings and
"resolution is everything" attitude. 4K videos play better on my 1080p screen
than 1080p videos, which should absolutely not be the case with reasonable,
non-skimpy bitrate settings.

------
Sevzinn
Since so much of youtube consumption is audio-only, why not have a codec
optimized to show nothing, or a still picture? Here at work we used to remote
into a machine just to play youtube songs over the speakers. No video needed.

~~~
chengsun
Video codecs are good at compressing stills, so there's very little overhead
in playing such a video when only the audio is desired.

That being said, YouTube does also encode audio-only versions of all their
videos; they're not available from the web player though. You can use external
software such as youtube-dl[1] to take advantage of it.

[1]: [https://github.com/rg3/youtube-dl/](https://github.com/rg3/youtube-dl/)
(using an invocation such as "youtube-dl -g -f bestaudio [url]" to retrieve
the URL of an audio-only encode)

~~~
roryokane
I don’t think that audio-only version comes from Youtube. I think youtube-dl
downloads the whole video, then uses ffmpeg to extract and possibly re-encode
its audio channel.

~~~
yohui
No, YouTube does have audio-only streams. You can use "youtube-dl -F [url]" to
view the available formats and their codes.

They're meant to be paired with the video-only streams used for some
resolutions (most notably 1080p). Even browser extensions such as YouTube
Center can download the streams, and they certainly don't use ffmpeg.

(In fact, I do use ffmpeg to combine audio-only and video-only streams via
youtube-dl, e.g. "youtube-dl -f 137+141 [url]" which takes 1080p video and
256k aac audio.)

------
aidenn0
It would be nice if they had an actual video comparison; I can make either of
two codecs that are even close in performance look way better with single
frame-grabs.

~~~
bqe
I am skeptical of the quality claims without evidence. Previous third-party
studies on VP8 and VP9 have said that both H.264 and HEVC (formerly H.265)
outperform VP9 on video quality and encoding speed[1].

[1]:
[http://iphome.hhi.de/marpe/download/Performance_HEVC_VP9_X26...](http://iphome.hhi.de/marpe/download/Performance_HEVC_VP9_X264_PCS_2013_preprint.pdf)

~~~
derf_
_> and encoding speed_

Table VI. Encoding Run Times for Equal PSNR_{YUV}, HEVC vs. VP9 (in %): 735.2

I.e., HM is over 7x slower than VP9's slowest settings. VP9 speeds have
improved dramatically since then, and it is now being used real-time (Google
is working on adding it to WebRTC), while still demonstrating significant
quality improvements over prior generations.

See also
[https://news.ycombinator.com/item?id=9329580](https://news.ycombinator.com/item?id=9329580)
w.r.t. the quality aspect.

~~~
nimish
HM is basically a tech demo. It's not meant to be a production encoder.

------
shmerl
Good, and hopefully Daala will be even better.

------
gamesbrainiac
I'd like to see a comparison of this and x265

------
bluthru
What about a comparison with HEVC?

~~~
p0nce
In most papers I've seen VP9 fared worse than HEVC:
[http://infoscience.epfl.ch/record/200925/files/article-
vp9-s...](http://infoscience.epfl.ch/record/200925/files/article-
vp9-submited-v2.pdf)

~~~
derf_
See also
[http://iphome.hhi.de/marpe/download/Performance_HEVC_VP9_X26...](http://iphome.hhi.de/marpe/download/Performance_HEVC_VP9_X264_PCS_2013_preprint.pdf)

Both of those are much older encoders, of course (nearly 2 years old in the
case of the PCS paper), and some of the settings they used were questionable,
e.g., what HEVC calls "constant QP" actually varies the quantizer based on the
frame type, while VP9 really uses the same quantizer, which can make a big
difference on metrics. Talking to the authors at PCS, they re-ran results
later with more relaxed QP settings, and VP9 got somewhat better, but still
didn't catch up with HEVC (on metrics).

Keep in mind all of these results are from people who have spent significant
time working in MPEG/ITU/JVT/JCTVC, and may have some inherent biases.
Google's own results looked much better:
[http://ieeexplore.ieee.org/iel7/6729645/6737661/06737765.pdf...](http://ieeexplore.ieee.org/iel7/6729645/6737661/06737765.pdf?arnumber=6737765)
(sorry for the paywall, I'm not aware of a free version available online,
tl/dr: 30.38% better rate than H.264, 2.49% worse than HEVC), but obviously
come with their own set of biases.

I don't know how to explain the discrepancies in the two sets of results, but
they at least demonstrate the magnitude of the differences you can obtain by
varying how you do the testing.

~~~
darkmighty
At some point comparing highly efficient codecs with metrics like PSNR becomes
meaningless, I'm not sure why so much emphasis is still put on it.
Verification against human preference is the way forward.

I believe methods like A/B preference testing have been done for audio codecs
for a few decades, idk why video didn't catch up.

In this respect I look forward to the work done by the Daala guys, seeing how
they come from the highly successful OPUS audio codec seem to be very mindful
of perceptual optimization.

~~~
anon1385
>At some point comparing highly efficient codecs with metrics like PSNR
becomes meaningless, I'm not sure why so much emphasis is still put on it.

Because (some) codec developers have put a lot of effort into optimising for
it, and simple numbers are easier to market to people who haven't actually
compared the codecs themselves. You can see how successful it is from the many
posts in this thread that assume VP9 gives you higher quality at the same file
size than H.264.

On2 codecs were known for relatively heavy blurring that improved PSNR stats
but looked subjectively worse. Most comparisons I've seen indicate this is
still the case with VP9. Of course it does depend a lot on the source material
- some things make it more noticeable than others.

------
dunny
Does anyone know if this format will work with youtube-dl and VLC?

~~~
jbk
Yes, VLC can play directly VP9, if you have an up-to-date release.

But to play the VP9 Youtube URLs, you need to be able to play DASH format too.

And this, DASH extension used by Youtube is not supported yet in VLC. However,
it should be, for the next major release.

------
RDeckard
I am curious: is YouTube going to re-encode all existing content with VP9? If
so, I am wondering if they do anything special to preserve as much quality as
possible. Are there any techniques to do that? (For example, certain JPEG
transforms such as rotation can be applied with zero quality loss.)

~~~
manigandham
Youtube keeps all the original source files so there's no quality loss going
from one encoding to another, if that's what you were referring to.

~~~
RDeckard
Do they really - do you have a source on that? (no pun intended)

~~~
jsalit
Yep, there's mention of it on an old blog post [1], but you can verify for
yourself on the Enhancements page when editing any video - there's a "Revert
to original" button.

[1] - [http://youtube-global.blogspot.com/2011/09/edit-your-
videos-...](http://youtube-global.blogspot.com/2011/09/edit-your-videos-with-
youtube.html)

------
toomuchtodo
Does anyone know if the Chromecast supports VP9?

~~~
lvs
This is an interesting point. I wonder if this portends a Chromecast hardware
update.

------
zk00006
Is there any technical report that describes how VP9 works internally?

~~~
vigneshv_psg
This I/O 2013 video has some technical information about the codec internals:
[https://www.youtube.com/watch?v=K6JshvblIcM](https://www.youtube.com/watch?v=K6JshvblIcM)

------
goodcjw2
to be honest, i don't feel vp9 vs h264 is a fair comparison. However, it's
good that someone is leading the way towards next generation.

------
Aissen
Yes, let's compare a 10-years old codec with an unfinished one. Meanwhile in
the industry, HEVC is winning the 4k codec wars.

~~~
the8472
VP9 spec has been finalized in 2013. So it's hardly unfinished. There may
still be optimization potential for the encoder, but that would only speak
_for_ VP9 because it would only get better.

I think making a comparison without providing information how they obtained
the results is much worse than the particular choice of codecs pitted against
each other.

How much CPU time did they burn on each encode? Which settings were used? did
they pick a frame at random or was cherrypicking involved? Or for that matter,
which encoders did they use?

~~~
Aissen
Thanks for the additional points, you're correct. In addition to the non-
scientific comparison (I'd expect better from a data-driven company like
Google, but this is a marketing post), it also completely ignores HEVC, which
is making headways in the wild.

Don't get me wrong, I think the "patent-free" VP9 is really nice, but I'm
afraid it won't win if it's not better technically, especially if HEVC-patent
pool prices are reasonable. Or maybe the only goal of Google is keeping patent
licenses affordable by maintaining competition ?

~~~
the8472
> Or maybe the only goal of Google is keeping patent licenses affordable by
> maintaining competition ?

That certainly is plausible considering that webm/vp8 probably played a role
in the MPEG LA extending its royalty-free exemptions internet broadcasting.[1]

It also provides google with some flexibility. They can (and do) use VPx now,
might switch to HEVC in the future if it proves favorable and could switch
back to VPx if some negotiations were to break down. Having options usually is
a good thing in itself.

[1]:
[http://www.mpegla.com/Lists/MPEG%20LA%20News%20List/Attachme...](http://www.mpegla.com/Lists/MPEG%20LA%20News%20List/Attachments/74/n-10-08-26.pdf)

------
rasz_pl
Gotta love google, yet another unaccelerated codec shoved down my core2
laptops throat to stutter at 10fps while mplayer plays 1080 h264 version just
fine.

------
yAnonymous
I'm wondering how these improvements compare to the ones H265 made. It almost
cuts the file size in half at the same quality.

------
curiousjorge
I can never watch anything above 720p because my video will begin stuttering
and sound starts to unsync.

------
madhavcp
What's the Weisman Score for this? :P

------
obilgic
Too bad, Youtube is just blocked in Turkey. One less thing to optimize.

