The Technology Behind Youtube

Anyone know if Youtube have changed how they stream?

I used to start a video on Youtube, pause it and the video would continue to download in its entirety. I could go away and make a tea and come back to a complete video 10 minutes later.

For several weeks, after I pause a video, the download also seems to also pause at a certain point. It is as if it has detected I am paused so stops the download. As soon as I resume play, the download resumes.

Is this a change at their end to conserve bandwidth?

My problem is that 720p content rarely streams fast enough for uninterrupted playback. I tend to start a video, do something else, then come back to the video.

One thing I have noticed is that in the past I would sometimes get an error message and have to refresh the page to get the video to play. Now it just shows the buffering symbol and doesn’t play. But if I refresh the page it’s fine. So it would seem that something has changed.

Yeah, I’ve noticed this as well. You can’t just hit pause and let the whole video load. Annoying, but I’m sure it was killing their bottom line.

Yeah, I’ve noticed this as well. You can’t just hit pause and let the whole video load. Annoying, but I’m sure it was killing their bottom line.

Well they could just not have videos stream automatically when you open certain pages. Stop annoying your customers and save bandwidth! It’s win/win.

I don’t understand why this would cost them more?

Pretty much; I’ve heard that stated as the confirmed reason multiple times, but don’t have a link or anything handy, so I guess don’t take it as Gospel ;)

Since TimeWarner is worthless shit at the “30” mbps tier, I’m lucky if a 720p video on Youtube will play seamlessly, and if it doesn’t, instead of adopting the “up quality and pause till it’s done” style of watching, I get to instead switch to “up quality, watch 10 seconds, load for 2 minutes, watch 30 seconds, load for 2 minutes, watch for 30 seconds. . .” pattern.

AKA, this change sucks donkey balls and Youtube should feel bad.

People open up 40 HD videos in new tabs, get tired after two, and walk away from the pc, never to watch 'em. The load in silence, drawing hundreds of megs of bw (apiece in some cases), then get unceremoniously closed a few hours later.

I am glad it is not just me. My wife thought I was mental yelling at my computer.

Anyway, posting the question inspired me to actually see if I could google an answer. Turns out I could!

This page got me the answer I needed.

Go to settings and under playback select “I have a slow connection”. This will default all vids to 360, but you can change quality as normal and in testing over the last 20 minutes, full video buffering is back for me.

Note, you may also need to switch off the HTML5 player, if you are opted into that. You can do that here.

https://www.youtube.com/html5

Full buffering would still not work for me in HTML5, but I confess to not restarting my browser, which may change have an effect.

So in short, stick to the flash video player and change to “slow connection”.

Keen to hear if this help you guys as well.

Could also be an HTML5 thing, but I was not opted into HTML5 before testing a few options.

I don’t know specifically what youtube.com is doing but there are differences in the way Flash and HTML5 video work. With Flash “progressive download” video can start playing as soon as there are enough frames of video to stream at the required frame rate. You can test for the full video to be downloaded, or show what is already downloaded.

HTML5 has a couple events named “canplay” and “canplaythrough” which supposedly do the same thing. “canplay” is fired when there is enough video downloaded to play at at the required frame rate. “canplaythrough” is fired when the entire video can be played. The problem is, instead of one vendor (Adobe) making sure the events work, the multiple browser vendors that need to implement the events for HTML5 video have done a spotty job. This seems to change every time a new browser version is released. For example when I was writing the first edition of my HTML5 Canvas book, Firefox would fire “canplay”. However 1/2 way through the writing, it stopped working. The “loop” property stopped working too. (these all work again).

My feeling is that, the same with CSS and JavaScript, to get the most support across the most browsers, you need to go for the lowest common denominator. In this case, it is probably waiting for the “canplaythrough” event to fire before video starts playing.

…and I could be completely wrong on this too.

The real problem with youtube is ISP-side caching. Your ISP may just fucking suck balls at caching youtube. I have a 50 megabit connection and I literally get 150KB/sec transfers from youtube with time-warner. Sometimes when you refresh the page a couple dozen times, you’ll get a “magic” connection, download at 5MB/sec, and everything is glorious-- but that is very rare, the rest of the time you’re in buffering hell. When your ISP caches youtube videos, the videos actually come from a site called something like

o-o.preferred.actbroadband-blr1.v3.lscache3.c.youtube.com

(I got this host from googling the issue just now, yours won’t be ACT broadband unless you live in bangalore india.)

That’s the cache. If that site is a piece of complete dogshit, your youtube will be slow. As far as I can tell there is absolutely no way to get around this caching, beyond (I guess) using a VPN or an external proxy.

Larger ISPs have hundreds of these servers, so it’s fairly difficult to add them all to a hosts file somewhere. Even if that was possible, switching to google DNS or opendns doesn’t fix the problem, so it seems like the requests are redirected somewhere anyway. If anyone has any tips for getting around this, I’m all ears-- there’s not a lot of info on the internet about why youtube is slow, just that it is.

Nope, sounds right to me. Welcome to the wonderful world of non-standards.

If you want, you can always extract the content from youtube with one or another handy hackish website (not sure which one is best at present, but there are lots), and then you’ll have it in non-streaming form.

If you are the type to wait till after buffering, you can just download the video, same difference right? I use YousableTubeFix, it’s a script so you have a download button right there in your browser, no extra program needed.

Brilliant!