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=”″></param><param name=”allowFullScreen” value=”true”></param><param name=”allowscriptaccess” value=”always”></param><embed src=”″ 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 320×240 video encoded with the Sorenson codec, the video will come in at a resolution of 480×360, encoded with the superior H.264 codec.

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

8 thoughts on “Embed high-res Youtube videos

  1. Aha! Thanks for posting this, Jason; adding the high quality code to the url is easy, adding to the embed is trickier.

  2. Yes, I noticed that &ap=%2526fmt%3D18 doesn’t work in Internet Explorer . More exactly, my customer notice and called me — pretty fookin irate they were.

    Why can’t Billy Gates get along with the other children?

Comments are closed.