All Sites

標籤

2008年11月16日 星期日

[toread][tech] High quality YouTube video hack (http://www.kottke.org/08/11/high-quality-youtube-video-hack)

kottke.org home archives + xml about kottke.org contact me
kottke.org - home of fine hypertext products

High quality YouTube video hack

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)

More about this page

This entry was published on November 13, 2008 at 12:09 pm.

Tags for this entry:  video  youtube  howto 

kottke.org is a weblog about the liberal arts 2.0 edited by Jason Kottke since March 1998. You can read about me and kottke.org here. If you've got questions, concerns, or an interesting link for me, send them along. Here's the kottke.org RSS feed kottke.org RSS feed.

Advertisement

Shutterstock

Shutterstock: 4.5 million surprisingly affordable RF stock photos & vectors.

dot dot dot

Advertise on kottke.org via The Deck.

Looking for work? Tags, tags, tags!

Many posts on kottke.org have been "tagged" with keywords, which activity results in collections of related posts like sports, infoviz, or bestof.

Recently popular tags (last 3 weeks)

2008election   barackobama   politics   video   photography   design   maps   food   music   books   remix   movies   infoviz   tv   nyc

All-time popular tags

movies   photography   books   nyc   science   food   lists   design   business   sports   video   weblogs   music   bestof   art

Some of my favorite tags

photography   economics   lists   bestof   infoviz   food   nyc   firstworldproblems   cities   restaurants   video   timelapse   interviews   language   maps   fashion   nsfw   remix  

Random tags

sunshine   prison   cities   barcade   marypoppins   lifeafterpeople   realestate   cars   fundraising   hosseinderakhshan   fridakahlo   sony   pentagram   movies   im

kottke.org

You're visiting kottke.org. All content by Jason Kottke (contact me) unless otherwise noted, with some restrictions on its use. Good luck will come to those who dig around in the archives. If you've reached this point by accident, I suggest panic. In memory of DFW, rest in peace. Thanks for everything.

沒有留言:

追蹤者