High quality YouTube video hack  NOV 13 2008

You may have noticed that the video of Burn-E I embedded looked a bit better than a normal YouTube video. YouTube has been quietly offering high-quality versions of some of their videos for quite some time via a "watch in high quality" link just underneath the player. It's not HD, but it's definitely an upgrade of YouTube's legendarily crappy video quality. By default all videos on YouTube and embedded on other sites load at normal quality, but there's a way to set your default viewing quality to high, link to high quality video, embed HQ video, and even save HQ videos for later viewing.

Set your default viewing quality to high:
When you're logged in, go to Account / Playback Setup / Video Playback Quality and set the option to "I have a fast connection. Always play higher-quality video when it's available."

Linking to YouTube videos in high quality:
If you need to link to a high quality video on your blog, append &fmt=18 onto the end of the YouTube URL, like so:

http://www.youtube.com/watch?v=MuqiGrWBRqE&fmt=18

Upon arriving at the YouTube page, you'll see the highest quality video that YouTube pushes out. The full technical details are available here...basically it's a mp4 encoded using H.264 with stereo AAC sound at 480x360.

Embedding high quality YouTube videos:
The &fmt=18 trick doesn't work here, but a similar trick does. For each of the URLs in the embeddable code that you get from YouTube, add &ap=%2526fmt%3D18 onto the end, like so:

<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/MuqiGrWBRqE&hl=en&fs=1 &ap=%2526fmt%3D18"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/MuqiGrWBRqE&hl=en&fs=1&ap=%2526fmt%3D18" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>

Saving high quality YouTube videos:
When you're viewing a high quality video on YouTube, you can use the KeepVid bookmarklet to download the mp4 file for later viewing on your computer, iPod, or iPhone. I tested this with the Burn-E video and the resulting mp4 was in letterbox format (480x198, or roughly the standard 2.40:1 aspect ratio).

BTW, here's a comparison of the low and high quality for the same video.

Low quality:

High quality:

Sources: Yahoo! Tech, jimmyr.com, My Digital Life.

Update: I switched the example videos and code because YouTube took the Burn-E video down.

Update: I got an email from a YouTube engineer who tells me that format 18 isn't even the highest quality you can get. Check out Dancing Matt in format 22, aka 720p. Furthermore, some videos don't have a format 18 version (if the uploaded movie doesn't have sufficient quality, for instance). (thx, phil)

Read more posts on kottke.org about:
how to   video   YouTube

kottke.org

Front page
About + contact
Site archives

Subscribe

Follow kottke.org on Twitter

Follow kottke.org on Tumblr

Like kottke.org on Facebook

Subscribe to the RSS feed

Advertisement

Ads by The Deck

Support kottke.org shop at Amazon

And more at Amazon.com

Looking for work?

More at We Work Remotely

Kottke @ Quarterly

Subscribe to Quarterly and get a real-life mailing from Jason every three months.

 

Enginehosting

Hosting provided EngineHosting