YouTube does 720P HD using H.264
- 2-25-2009
- Categorized in: H.264 production, H.264 reference, Peer review, Streaming production, Working with YouTube
I just finished testing YouTube's new H.264-based HD video, and it is very compelling. You can see the video I uploaded at the YouTube site, click here.
Briefly, to have your video encoded in HD, all you have to do is upload the video in 720p format. Note that the usual file size (1 GB) and duration limits (10 minutes) apply. You can upload in a variety of formats; I used H.264. YouTube first creates a very ugly 320x180 video for normal viewing, then the big enchilada.
Video Encoding Parameters
What do we know about the video? Well, thanks to the information screen of the free MediaInfo video analysis tool, we know quite a bit. For starters, we can see that YouTube is producing the file at 720p (1280x720) at a video data rate of about 2 mbps, which translates to a fairly economical .072 bits per pixel. By way of comparison, Apple used .089 bits per pixel for a recent marketing video, while Cranky Geeks uses .072, pretty much identical to YouTube.
On the H.264 front, YouTube is encoding with the High profile with CABAC enabled. These are the specs I've been recommending for awhile, but few real world publishers have actually used them, so it's nice to get affirmation from the largest video publisher in the world. Of course, those producing with Apple Compressor, including, presumably, Apple, can't use either advanced parameter because Compressor doesn't support CABAC or the High profile. In addition, only the most recent versions of the QuickTime Player could play back the High profile, so if you were producing for QuickTime playback, the Main profile made more sense.
On the other hand, the Flash Player can play all levels of the High profile, as well as Main and Baseline, so when producing H.264 for Flash, High is the way to go. Interestingly, though not shown, YouTube produced the file with an MP4 extension for playback in the Flash Player, not the F4V. Flash Player doesn't care, it will play either format, but F4V is the extension used by most recently released encoding tools.
Audio Encoding Parameters
On the audio front, YouTube encoded with AAC LC, with two channels (e.g. stereo) to a data rate of 93 kbps. I would have used mono here to save a channel, but nobody asked. If you've been encoding with MP3, you probably think that the 93 kbps is miserly, but AAC LC is much higher quality compression, so should approximate at least 128 kbps MP3, if not higher.
Other Encoding Parameters
What else do we know about the file? Thanks to Inlet Semaphore, we can really dig into the file for details.

Semaphore's useful file analysis tool.
I've attached Semaphore's file analysis output to this article. From that, you can see that YouTube used a maximum of 3 reference frames (I've been using 4). From the frame graph above, you can see that YouTube inserted a key frame every two seconds (the little vertical lines below the time line are key frames). I prefer one every ten seconds because it should improve quality slightly and reduce pulsing, or a periodic, noticeable pulse each time a key frame updates the entire frame. YouTube did enable key frames at scene changes, which is why you see key frames at irregular locations.

I used Semaphore's frame analysis tool to identify how frequently YouTube inserted B frames, and it looks like they used a value of 2, which means 2 B-Frames between each P or I-Frame, which is in line with my recommendations.
Analysis
For better or for worse, love it or hate it, YouTube is the single largest distributor of streaming video on the planet, so their video-related actions are always noteworthy. As a video producer, I like that YouTube is willing to be my HD content delivery network, though I'm sure the quality of service guarantees are limited (har, har). Note, also, the player concerns discussed below.
YouTube's configuration also reflects their obvious judgment that a useful number of 'Netizens can receive video in real time at 2.1 mbps second, which is among the highest streaming data rates that I've seen. That raised my eyebrows. If you're producing H.264, YouTube appears to be saying that the High profile with CABAC is the way to go. Again, I'd recommend using a longer key frame interval, but the number of B-Frames and reference frames are spot on.
I've embedded the video below. Note that you can access the HD version by clicking on the lower right, but that the player won't expand like it does on YouTube. You can click the full screen button to view the video in full screen, where the full resolution is apparent.
Briefly, to have your video encoded in HD, all you have to do is upload the video in 720p format. Note that the usual file size (1 GB) and duration limits (10 minutes) apply. You can upload in a variety of formats; I used H.264. YouTube first creates a very ugly 320x180 video for normal viewing, then the big enchilada.
Video Encoding ParametersWhat do we know about the video? Well, thanks to the information screen of the free MediaInfo video analysis tool, we know quite a bit. For starters, we can see that YouTube is producing the file at 720p (1280x720) at a video data rate of about 2 mbps, which translates to a fairly economical .072 bits per pixel. By way of comparison, Apple used .089 bits per pixel for a recent marketing video, while Cranky Geeks uses .072, pretty much identical to YouTube.
On the H.264 front, YouTube is encoding with the High profile with CABAC enabled. These are the specs I've been recommending for awhile, but few real world publishers have actually used them, so it's nice to get affirmation from the largest video publisher in the world. Of course, those producing with Apple Compressor, including, presumably, Apple, can't use either advanced parameter because Compressor doesn't support CABAC or the High profile. In addition, only the most recent versions of the QuickTime Player could play back the High profile, so if you were producing for QuickTime playback, the Main profile made more sense.
On the other hand, the Flash Player can play all levels of the High profile, as well as Main and Baseline, so when producing H.264 for Flash, High is the way to go. Interestingly, though not shown, YouTube produced the file with an MP4 extension for playback in the Flash Player, not the F4V. Flash Player doesn't care, it will play either format, but F4V is the extension used by most recently released encoding tools.
Audio Encoding Parameters
On the audio front, YouTube encoded with AAC LC, with two channels (e.g. stereo) to a data rate of 93 kbps. I would have used mono here to save a channel, but nobody asked. If you've been encoding with MP3, you probably think that the 93 kbps is miserly, but AAC LC is much higher quality compression, so should approximate at least 128 kbps MP3, if not higher.
Other Encoding Parameters
What else do we know about the file? Thanks to Inlet Semaphore, we can really dig into the file for details.

Semaphore's useful file analysis tool.
I've attached Semaphore's file analysis output to this article. From that, you can see that YouTube used a maximum of 3 reference frames (I've been using 4). From the frame graph above, you can see that YouTube inserted a key frame every two seconds (the little vertical lines below the time line are key frames). I prefer one every ten seconds because it should improve quality slightly and reduce pulsing, or a periodic, noticeable pulse each time a key frame updates the entire frame. YouTube did enable key frames at scene changes, which is why you see key frames at irregular locations.

I used Semaphore's frame analysis tool to identify how frequently YouTube inserted B frames, and it looks like they used a value of 2, which means 2 B-Frames between each P or I-Frame, which is in line with my recommendations.
Analysis
For better or for worse, love it or hate it, YouTube is the single largest distributor of streaming video on the planet, so their video-related actions are always noteworthy. As a video producer, I like that YouTube is willing to be my HD content delivery network, though I'm sure the quality of service guarantees are limited (har, har). Note, also, the player concerns discussed below.
YouTube's configuration also reflects their obvious judgment that a useful number of 'Netizens can receive video in real time at 2.1 mbps second, which is among the highest streaming data rates that I've seen. That raised my eyebrows. If you're producing H.264, YouTube appears to be saying that the High profile with CABAC is the way to go. Again, I'd recommend using a longer key frame interval, but the number of B-Frames and reference frames are spot on.
I've embedded the video below. Note that you can access the HD version by clicking on the lower right, but that the player won't expand like it does on YouTube. You can click the full screen button to view the video in full screen, where the full resolution is apparent.

Thanks for your note. YouTube's HD seems to work most reliably when you upload 720p footage. I would always avoid scaling and deinterlacing in YouTube because results have consistently been mediocre.
Let me know how it works out for you.
Jan
Jan
I use Final Cut and Compressor. What is the best bang for the buck as a Compressor plug in to get the H.264, High profile with CABAC enabled ? Would I be better served to get a stand alone encoding product? Any upgrades to Compressor to include this profile that you know about?
I guess you could consider Episode as a plug-in that enables bot High profile and CABAC. I'm guessing that there are others, but I haven't played with any. You can run Episode as both a plug-in and standalone product.
As far as I know, there have been no Compressor upgrades that enable these functions released by Apple.
I haven't tried with YouTube yet, but intend to do so, soon.
Thanks for the article.
Sigh. I hate to air my dirty laundry, but this clip was produced as a video test tape, with audio quality secondary. So I wouldn't draw any conclusions about YouTube's audio quality based upon this clip.
Thanks for weighing in.
Jan
Thanks!
Jan
Here's what I know (an intermediate editor using Sony Vegas)
*H.264 is the encoder to use
*1280x720 is a must
Now, what happens if I upload the native 720p video (59.940 frames per second). Youtube re-encodes down to 30fps, which would delete frames.
Would it be best to render the video with 30fps before uploading?
Thanks for your note.
Tough to debug problems remotely. All I can tell you is that uploading 720p videos has worked for me. In general, whenever working with YouTube, you should upload videos at the resolution you want displayed.
Sorry I can't be more helpful.
Thanks.
Jan
Thanks for your note!
My policy with YouTube is to always upload in exactly the specs that I want displayed so YouTube has to do as little processing as necessary. So I would definitely change the frame rate before uploading.
Thanks again for your note.
Jan
a) This video shot indoors with natural lighting from window
http://www.youtube.com/watch?v=Am_3dhkp68Q
b) This close-up video of "hairs" on a miniature cactus plant - again shot with low cost camcorder:
http://www.youtube.com/watch?v=E-Mji-xpVFE
http://www.youtube.com/watch?v=Am_3dhkp68Q
This is great! I am diving into the world of FLV for corporate applications, if it makes sense and this bit of info helped a great deal in getting a jump ahead!
Thanks!
Nico
Wow, my little web site helping a Streaming Media All Star such as yourself. I'm very proud!
:-)
Glad to be of service, Nico, and please drop by often.
Jan
Though in my case Youtube didn't touch frame rates of the uploaded 20 fps and 25fps 720p videos. Also the bit rate was fairly low 500-700 kbps. The videos were basically screencasts.
Thanks for weighing in. Would love to see a link to your youtube videos; i haven't had such great results with screencasts on youtube and I'd like to figure out how to do it.
For submissions, I just publish in 720p from Windows Movie Maker.
I have seen some of your videos at Vimeo, do you have any ideas which standards Vimeo uses, or can you recommend enconding options suited for Vimeo, (not that you can compare youtube and vimeo content imo)
Do you have any ideas how to make videocontent more smooth eksamble with borderlines on things in movement, especially HD content looks a bit unnatural in the way it moves - laggy sort of way..
I don't have any association with YouTube and don't know how they chose their parameter. I'm guessing that the differences are minor; the key points (for me) are that they use the High Profile and CABAC.
I haven't studied Vimeo's outputs. Key for me is that they don't scale down 640x480 screencams, while YouTube does. That's why I use them. For real world video, YouTube is great, but screencams come out awful.
Not sure that i understand your final question, sorry. Please rephrase, thanks.
deinterlace.
h.264
how about key frame ? you said higher the better, how much ?
will the automatic frame re-ordering work better ?
any little words for newbie would be great. this is a wonderful article with lots of info. thank you so much.
-- ruben
Thanks for the kind words. YouTube used a key frame every two seconds, I prefer one every ten seconds.
YouTube did use frame reordering - whenever a file has B-frames, the producer used frame reordering. Note that the term "frame reordering" is an Apple concept from Compressor, not a true H.264 concept.
You've inspired me to create a new article H.264 for the newbie. You can view it here.
http://www.streaminglearningcenter.com/articles/93...
Best!
Jan
Glad to help. Thanks for writing.
Jan
Thank You for educating me on this subject :-)