
YouTube Video Formats
Different formats are created depending on the dimensions of your source videos. Here is a comparison of what versions you can expect when you upload your videos. Other formats may be created as well, but at the time of this post, these are the ones you are most likely to encounter. Once you upload your video and wait for all the versions to be encoded, you can force YouTube to show you the different versions by appending fmt= and the format number. (http://www.youtube.com/watch?v=Vf_PtJeTbuI&fmt=22) The technique for embedding players with different formats is explained further in this post.
High Definition (16:9) e.g. Upload a 1280×720 or 1920×1080 video
- fmt=0 (Default low quality version)
Video: 320×180 H.263 (Sorenson Spark) FLV Approx. 330 Kbps
Audio: MP3 Approx. 64Kbps 22KHz MONO - fmt=6 (Higher quality FLV version)
Video: 480×270 H.263 (Sorenson Spark) FLV Approx. 800 Kbps
Audio: MP3 Approx. 96Kbps 44.1KHz MONO CBR - fmt=18 (High quality MP4)
Video: 480×270 AVC H.264 MP4 Approx. 500 Kbps VBR
Audio: AAC Approx. 128Kbps 44.1KHz Stereo VBR - fmt=22 (Highest quality MP4)
Video: 1280×720 H.264 MP4 Approx. 2Mbps VBR
Audio: AAC Approx. 254Kbps Stereo VBR
Notes:
The full HD fmt=22 version is one of the best video formats seen on the web. Unfortunately YouTube does not have a option to display it at the actual 1280×720 dimensions.
Standard Definition Widescreen (16:9) e.g. Upload a 480×270 video or any video that is 16:9 and less than 1280×720
- fmt=0 (Default low quality version)
Video: 320×180 H.263 (Sorenson Spark) FLV Approx. 340 Kbps
Audio: MP3 Approx. 64Kbps 22KHz MONO - fmt=6 (Higher quality FLV version)
Video: 480×270 H.263 (Sorenson Spark) FLV Approx. 800 Kbps
Audio: MP3 Approx. 96Kbps 44.1KHz MONO CBR - fmt=18 (Highest quality MP4)
Video: 480×270 AVC H.264 MP4 Approx. 500 Kbps VBR
Audio: AAC Approx. 128Kbps 44.1KHz Stereo VBR
Notes:
The 16:9 options are encoded at almost identical data rates to the 4:3 videos. Again, I am surprised that they did not release a format at 640×360.
Standard Definition (4:3) e.g. Upload a 640×480 video
- fmt=0 (Default low quality version)
Video: 320×240 H.263 (Sorenson Spark) FLV Approx. 340 Kbps
Audio: MP3 Approx. 64Kbps 22KHz MONO - fmt=6 (Higher quality FLV version)
Video: 480×360 H.263 (Sorenson Spark) FLV Approx. 900 Kbps
Audio: MP3 Approx. 96Kbps 44.1KHz MONO CBR - fmt=18 (Highest quality MP4)
Video: 480×360 AVC H.264 MP4 Approx. 500 Kbps VBR
Audio: AAC Approx. 128Kbps 44.1KHz Stereo VBR
Notes:
I am really surprised that they do not offer 640×480 version, especially now that they support HD sizes. 640×480 would be ideal for SD content on fast broadband connections.
How to set different YouTube formats in embedded players
If you have ever tried to embed a YouTube player to your site, you have noticed that even though they offer multiple size options, they only stream the low (fmt = 0) videos. On the HD videos embedded players, they do offer a toggle for HD, but there is no option like this on the SD player and no guarantee that your site visitors will know it is there.
Fortunately, there is a easy work around so that you can embed videos on your site at any quality format (fmt) that your video has been encoded to. Additionally, you can set the player frame size to match the encoded frame size of your video.
First, copy the embed code from the YouTube website. It should look similar to the following snippet.
<object width=”640″ height=”385″>
<param name=”movie” value=”http://www.youtube.com/v/Vf_PtJeTbuI&hl=en&fs=1″>
</param>
<param name=”allowFullScreen” value=”true”></param>
<param name=”allowscriptaccess” value=”always”></param>
<embed src=”http://www.youtube.com/v/Vf_PtJeTbuI&hl=en&fs=1” type=”application/x-shockwave-flash” allowscriptaccess=”always” allowfullscreen=”true” width=”640″ height=”385″>
</embed>
</object>
In both places where it shows the URL to the video, you will need to replace the code “&hl=en&fs=1” with “&ap=%2526fmt%3D22” where the 22 at the end corresponds to the format number you want to display. Here is what it would look like for all the different formats above:
http://www.youtube.com/v/Vf_PtJeTbuI&ap=%2526fmt%3D0
http://www.youtube.com/v/Vf_PtJeTbuI&ap=%2526fmt%3D6
http://www.youtube.com/v/Vf_PtJeTbuI&ap=%2526fmt%3D18
http://www.youtube.com/v/Vf_PtJeTbuI&ap=%2526fmt%3D22
For best results, you should set the width and height (both locations) to match the encoded width and height (+25 to the height in order to account for the player controls) of the format number you choose. For example, to display a full HD version (fmt=22) you will set the width and height to width=”1280″ and height=”745″ (720 + 25). Here is a example of the embed code above modified to display the full HD version. View Demo
<object width=”1280″ height=”745″>
<param name=”movie” value=”http://www.youtube.com/v/Vf_PtJeTbuI&ap=%2526fmt%3D22“>
</param>
<param name=”allowFullScreen” value=”true”></param>
<param name=”allowscriptaccess” value=”always”></param>
<embed src=”http://www.youtube.com/v/Vf_PtJeTbuI&ap=%2526fmt%3D22” type=”application/x-shockwave-flash” allowscriptaccess=”always” allowfullscreen=”true” width=”1280″ height=”745″>
</embed>
</object>
Download and inspect your videos
If you want to learn more about the various formats that YouTube encodes your videos to, you should download them and look at the specs. Although YouTube has started putting dowload links on some videos, with the right tools you can download any format of any video quite easily. There are many sites such as KeepVid (http://keepvid.com) that allow you to enter the YouTube URL and download, but I have found in my experience that they do not offer downloads for all the formats.
The best method I have found so far is by using the Firefox extension Download Helper (http://www.downloadhelper.net/). Once installed you simply navigate to the video page you want to download, select the format and start the video. Then the drop down will appear in your toolbar to be able to download.
Once downloaded, you can use the free open source VLC player (http://www.videolan.org/vlc/) to view either MP4 or FLV videos. To view the specs for your videos I highly recommend the free open source MediaInfo tool (http://mediainfo.sourceforge.net/en). MediaInfo tool is amazing and will allow you to view everything from codecs to bitrates and other metadata available in your files.

Details from my fmt 22 YouTube HD Video
YouTube APIs and Tools
YouTube offers several APIs and tools you can use to further integrate YouTube’s content into your own website or application. Basic tools include adding a YouTube search or video bar to your site in a few minutes without advanced web skills.
Search Bar Demo | Video Bar Demo
For developers looking to design their own embedded players in Flash or chromeless players controlled by JavaScript, the Player API has you covered. The Data API allows developers using server-side programming advanced integration with virtually every aspect of YouTube, including uploading, searching, feeds, related videos ad more. Full developer guides for different languages are provided.
The Getting Started Guide (http://code.google.com/apis/youtube/getting_started.html) is a great place to learn more about the available APIs and Tools.
The YouTube Community
If you have not been to the YouTube help forums (http://help.youtube.com/group/youtube-help?pli=1) , they offer a wealth of infomration and you should definitely check them out. The Announcements forum will keep you up to date with the latest features added to the system and the “How do I…” section is good to find out more about issues you and other users may be experiencing and how to accomplish certain tasks within the system. You can also post bugs and feature requests.
Related posts
3 Comments
Thanks for all those information, really really great for anyone interesting in make better streaming video.
Can I translate some of them and posting to my site ? Of course I will credit and link back.
Feel free to translate, but please let me know once you post and include a link back.
Hey, thanks for these tips. Exactly what I was looking for – my client’s embedded video keeps stopping and starting – changing the quality to medium or low via the embed code should help out a lot.