YouTube does 1080p with H.264

On November 12, YouTube announced that “1080p HD Is Coming to YouTube.” In this article, I’ll describe the type of file you should upload to trigger 1080p encoding, analyze the 1080p files created by YouTube and detail the other files created by YouTube in addition to the 1080p file.

My workflow was simple; I uploaded four 1920×1080 files to YouTube, one a 1080i file in HDV format, the other 1080p files in H.264 format, encoded at about 10 mbps. Then I went to YouTube and started downloading the files via the FireFox plug-in Download Helper.

YouTube encoded all four files into 1080p format. I used several tools to analyze the files, starting with Jerome Martinez’s excellent MediaInfo tool which is available for both Mac and Windows. Here I learned the basics:

Video:

  • 1920×[email protected] fps
  • High Profile, Level 4
  • CABAC enabled
  • Data rate 3,514
  • Bits/(Pixel*Frame): 0.057

1080p-1.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

By way of comparison, as discussed in my article YouTube does 720P HD using H.264, YouTube’s 720p video was encoded at 2 mbps, for a Bits/(Pixel*Frame) of 0.072. The decrease in Bits/(Pixel*Frame) doesn’t mean that the quality is worse – it tends to prove that H.264, like all video codecs, is more efficient at higher resolutions. In any event, if the Bits/(Pixel*Frame) of your video is greater than 1.0, you may be able to cut the video data rate with no loss of perceived quality.

On the audio front, MediaInfo revealed that YouTube produced the stereo audio at 125 kbps (compared to 93 for 720p), encoding with the AAC Low Complexity codec.

Other File Details:

What else can we tell about the file? A quick look at Inlet Technologies Semaphore product reveals a couple of interesting details.

1080p-2.jpg

First, YouTube uses a keyframe every two seconds or so; I personally use and recommend a keyframe setting of ten seconds. Second, according to Semaphore, YouTube isn’t using any B-frames, just P and I frames. When I originally tested YouTube’s 720p encodes, Semaphore revealed that YouTube was inserting two B frames between P and P frames, and I and P frames. I retested that file and reached the same conclusion, then tested two 720p YouTube files uploaded after that time and found that YouTube wasn’t using any B frames in those either.

In Compression 101, we all learned that B frames were the most efficient frame because they can reference redundancies in frames located before or after the B frame. This efficiency should translate the quality. The downside is encoding speed, since searching in both directions certainly takes longer, and also playback complexity, since to display a B-frame, you need all frames that the B-frame references to be decoded and available in the playback buffer. This complexity translates to higher horsepower requirements on the playback station, which could lead to dropped frames during playback.

From this data we could postulate that YouTube stopped using B-frames because:

  • It was taking too long to encode the files.
  • The files were playing back too slowly on some computers.
  • B-frames didn’t enhance quality enough to make a difference.

Or, it could be some other reason. Overall, since YouTube encodes more video files than any other site on the planet, it does give one pause. I’ll have to rethink my H.264 encoding recommendations with this data in mind.

Other Files Created

In addition to the 1080p files detailed above, YouTube created a number of lower resolution files for the files that I uploaded, as detailed in the table below.

 Designation Resolution Codec

 Data Rate

 Audio

Bits (Pixel*Frame)

       Original 400×226 H.263 261 kbps
 Stereo/59 kbps
 .096 HQ 640×360 VP6 669 kbps
 Stereo/107 kbps
 .097 1080p 1920×1080 H.264 3.514 mpbs
 Stereo/125 kbps
 .057      

I’ve run some other tests with YouTube involving SD/720 input files that you can read about here. In these tests, in addition to the Original and HQ options shown in the table, YouTube created so called HQ18 files (480×270 H.264 files @ either 415 or 525 kbps video), HQ35 files (854×480 VP6 files@1177 kbps video) and HQ22 files (1280×720 H.264 @ 2242 kbps video). YouTube did not create any of these file types for any of the four videos that I uploaded.

When did YouTube playback the files created? As you probably know, the YouTube player has three states; small embedded window, large embedded window and full screen. You can also configure your connection speed according to the following settings.

1080p-3.jpg

With these variables in mind, YouTube appeared to display the files according to the following logic

  • Original file – small player, low connection speed.
  • HQ – small/large player, fast connection speed
  • 1080p – full screen player

The only consistently repeatable result was that YouTube only seemed to play the 1080p file during full screen playback – the other two files generally appeared as noted, but not universally.

If you’d like to watch one of the files that I created, click here to see my favorite local band – Galax’s own No Speed Limit – performing Wayfaring Stranger.

Let’s summarize:

  • YouTube appears to encode all 1080 files uploaded to the site into 1080p format.
  • The file is produced using the H.264 codec at about 3.5 mbps, in the High profile with CABAC enabled, but no B-frames. YouTube also creates at least two other formats for lower resolution playback.
  • The most reliable way to play the 1080p file is to click the full screen option in the YouTube player.

About Jan Ozer

Avatar photo
I help companies train new technical hires in streaming media-related positions; I also help companies optimize their codec selections and encoding stacks and evaluate new encoders and codecs. I am a contributing editor to Streaming Media Magazine, writing about codecs and encoding tools. I have written multiple authoritative books on video encoding, including Video Encoding by the Numbers: Eliminate the Guesswork from your Streaming Video (https://amzn.to/3kV6R1j) and Learn to Produce Video with FFmpeg: In Thirty Minutes or Less (https://amzn.to/3ZJih7e). I have multiple courses relating to streaming media production, all available at https://bit.ly/slc_courses. I currently work as www.netint.com as a Senior Director in Marketing.

Check Also

Mac Video Apps for Streaming Professionals

Though I work primarily on Windows computers, I also have several Macs. Here are the …

Choosing the Best Preset for Live Transcoding

When choosing a preset for VOD transcoding, it almost always makes sense to use the …

There are no codec comparisons. There are only codec implementation comparisons.

I was reminded of this recently as I prepared for a talk on AV1 readiness …

Leave a Reply

Your email address will not be published. Required fields are marked *