Embed high-res Youtube videos

Here's an example of a normal embedded Youtube video, borrowed from Patti Schiendelman's Gakken Mechamo Inchworm post.

Back in march, it was discovered that when you view a video directly on Youtube, you could add a "&fmt=18" to the URL to enable a higher quality, higher resolution stream which is encoded with the H.264 codec.

To make this work in an embedded video, however, you need a slightly different hack. After pasting the embed code into a blog post, adjust the two video URLs (one in a param tag and one as the src parameter in the embed tag) by adding "&ap=%2526fmt%3D18" to the end.

For example, the above video embed becomes:

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

And here's the result:

The still frame before the video is played is the exact same over-compressed image, but when a user clicks play, they will get a nice surprise. Instead of 320x240 video encoded with the Sorenson codec, the video will come in at a resolution of 480x360, encoded with the superior H.264 codec.

Embedding High Quality Youtube Videos [via Kottke]
View YouTube in high-res

Posted by Jason Striegel | Nov 13, 2008 08:59 PM
Video, Web, YouTube | Permalink | Comments (1) Bookmark and Share

Recent Entries

Comments

Newest comments listed first.

Posted by: Stu on November 16, 2008 at 3:25 PM

Anybody tried to load an embedded hi-quality video in Google Chrome? On my PC, Chrome refuses to play the HQ video on this article, it just shows the 'buffering' graphic persistently.
IE7 on the other hand fires up the video immediately.
Is it just my system?


Leave a comment



Bloggers

Welcome to the Hacks Blog!

Brian Jepson.Brian Jepson


Jason Striegel.Jason Striegel


Philip Torrone.Phillip Torrone



See all of the books in the Hacks Series!
Advertise here.

Recent Posts

www.flickr.com
photos in Hacks More photos in Hacks