YouTube Upload Formats: “That Old Chestnut”

Summary:

When uploading to  YouTube (or Vimeo or indeed most online video services), the uploaded video need not be in the format that will ultimately be served to the audience. Instead, it is essentially in an an archive role, and based on this archive, the services will (now and/or in the future) encode their own copies at various resolutions.   The uploaded “archive” should therefore be of the best quality, and is not constrained to be in a format that plays well on most target devices.

YouTube defines two upload-formats: Standard (for typical enthusiast videos) and Enterprise (for serious matter such as movies or corporate productions).  A 5-minute video in Standard format may be about 350 MB while in Enterprise format it may be around 2GB.  So for practical purposes, Enterprise format requires an Enterprise internet-connection.

  • Standard-Level Encoding:
    • YouTube gave good results when the video was uploaded in H264 at 8 mean 16 max Mbps.
      • I (currently) believe this is a good practical upload-format to use in most cases.
        • It has given good results for general scenes (in the experience of others as well as myself).
      • My maximum bitrate (16Mbps) exceeds Adobe’s YouTube 1080 preset, which defines 8Mbps mean=max.
      • However it is way below YouTube’s official (and YouTube-expert-confirmed) advice of 50Mbps (mean=max) for Enterprise-class (productions and internet connections).
        • I wonder whether such high bandwidth is only really of advantage to fast-changing scenes e.g. foamy sea-spray or to future derivation of 4K from it etc.
        • It could presumably be regarded as a useful format for archiving in general, at least where no subsequent significant levels/color manipulation was intended.
    • Poor results were obtained when uploaded (mistakenly) at 720p25 at 5 Mbps (mean=max), especially when played (from YouTube) at lower resolutions, when blocking was apparent.
    • I am not too sure about Adobe Media Encoder’s YouTube 1080 preset, maybe it is slightly under-specified, the audio bitrate as well as the video bitrate.
  • Enterprise-Level Encoding via custom settings in Adobe Media Encoder (version CC of August 2013)
    • These are essentially “BluRay-like” / “Gold Standard” formats, from which YouTube’s servers can derive multiple present-day play-formats.  Their use should also result in good-quality archive material from which, in future, to derive further (as yet uninvented or not-yet-popular) formats.  To “stand the test of time”…
    • Audio 320Kbps
    • Video:
      • Bitrate:
        • 50 Mbps for 1080p (25 fps)
        • 30 Mbps for 720p (25 and 50 fps?)
      • Level:
        • 4.2
          • General H264 advice is use lowest Level that permits (includes as an option) your required bitrate.
          • Level 4.2 additionally has a reasonable number (hence density) of macro-blocks.
      • Mode
        • Mode should be [High] (as opposed to [Baseline] or [Main] ).
          • [High] implies CABAC encoding (which is computationally-intensive but gives superior-quality results) and two B-frames.
            • These are both requirements for Enterprise-class YouTube uploads.
            • We are essentially uploading an archive format as opposed to playable, so we don’t care how computationally intensive it is.
      • Key Frames Distance
        • Same thing as GOP size or length (I assume).
        • YouTube’s official spec says it should be half the frame-rate…
          • e.g. 12 in the case of 25 fps ?
          • As opposed to a general rule of thumb (elsewhere) of three times the fps.
            • e.g. 75 frames in the case of 25 fps or 150 frames for 50 fps.
              • Scary numbers…
              • Various people report less smooth motion when shorter keyframe distances are used.  But maybe that only applies to lower bitrates?
      • B-Frames:
        • This is the number of bi-directional (B) frames between I and P frames, e.g. a value of 3 would give: [IBBBPBBBPBBBPBBBP]
        • The recommended number is 2 for YouTube-Enterprise context (as opposed to 3 in some other contexts).

Details:

I had shot two videos on my trusty Sony EX3 camera, one at 1080p25 the other at 720p50.

Reason?  The first one was a standard live entertainment event, demanding some run&gun, hence I shot it at highest definition.  However the other event was a sporting one, and 50 fps provides more potential for handling fast action in various ways (smoother action or slow motion).  On this camera, 50fps was only possible in 720p, not 1080p (the camera can also record 1080i50 (fields/second), from which one can generate motion-estimated full-frame 1080p50, but that is extra work, not conducive to productivity, hence best avoided).

On my Adobe CC editing system, I completed the 720p50 video first, then encoded that to 720p25 (Adobe Premiere CC’s YouTube preset, of 5Mbps, mean=max) for checking and eventual upload to YouTube.  A day or two later I completed the (longer) 1080p50 video, then similarly encoded that to 720p25 for smaller file and faster upload for the draft/check process.

Then came time to upload the 1080p25 video to YouTube, initially with distribution set to Private.  It was late and I forgot to change the encoder setting to 1080.   Mistakes can happen, that’s why it was initially made Private and why a test-play or two at various resolutions was in order.   When played (from YouTube), not only did this reveal the reduced resolution, unexpectedly there was also some very obvious blocking on fast action, especially when the YouTube video was played at lower resolutions.

…Which of course illustrates the exact purpose of Quality-Checking is for, in the workflow…

Naturally the first thing to so was re-encode at 1080 (duh!).  Adobe’s YouTube-preset for this used a VBR bitrate 8 Mbps (mean=max).    Then also I also increased the maximum bitrate to 16.  I hadn’t time for experimenting, so I just made a best-guess.  Result: Success!  Following upload of the result to YouTube, test-plays of this looked far better in all respects at the various play-resolutions.

So I did some further web-research … which led me down a (finite) “rabbit-hole” wherein I discovered the existence of two kinds of upload-format standards: Standard (a few Mbps) and Enterprise (BluRay-ish, tens of Mbps).  Aghast at the latter, I did further web-searching, which confirmed it.

Web-Research:

  • Google:[youtube upload formats h264] and subsequent links:
    • http://www.streamingmedia.com/Articles/Editorial/Featured-Articles/Encoding-for-YouTube-How-to-Get-the-Best-Results-83876.aspx
      • There is a lot of good technical advice here about encoding.
      • At a high level, YouTube provides recommendations for two classes of users; standard quality and those with “professional quality content” and “enterprise quality internet connections.” After covering the basics, I’ll share these specific resolution and data rate recommendations with you.
        • Standard: 8Mbps
        • Enterprise: 50Mbps
          • {Note that this is beyond Adobe CC present for [HD 1080p 25], which specifies 32 mean 40 max Mbps}
    • http://www.pmi.tv/blog/2013/05/vimeo-youtube-uploads-made-easy/
      • A “word-ier” article, confirming the (astoundingly huge) Enterprise bitrate of 50 Mbps.
    • https://support.google.com/youtube/answer/1722171?hl=en
      • {YouTube’s official specifications-page}
      • Advanced encoding settings – Recommended bitrates, codecs, and resolutions, and more
      • Video Codec: H.264
        • Progressive scan (no interlacing)
        • High Profile
        • 2 consecutive B frames
        • Closed GOP. GOP of half the frame rate.
          • {As opposed to three times the frame-rate that some others use as rule of thumb…?)}
        • CABAC
        • Variable bitrate. No bitrate limit required, though we offer recommended bit rates below for reference
        • Color Space: 4.2.0
      • Bitrates:
        • Audio (mono/stereo/5.1): 128/384/512 kbps
          • Regardless of STandard/Enterprise)
        • Video:
          • Standard:
            • 1080p: 8Mbps
            • 720p: 5Mbps
          • Enterprise:
            • 1080p: 50 Mbps
            • 720p: 30 Mbps
    • http://forums.creativecow.net/thread/20/868497
      • Chris Borjis on Dec 20, 2011
        • I’ve done lots of video compression over the years and my clients like the fact all of their content looks great on youtube.  All of the info looks good on the specifications. The enterprise bitrates seem excessive though.  I’ve found that 1080 video usually looks just fine with no artifacts if you encode it at 8,000 kbps. Even the most complex, fast moving content. A lot of content can do just fine at 5,000 kbps anything more than that seems to be excessive in my opinion and experience of encoding nearly thousands of videos in the last ten years.
      •  Colleen Henry on Dec 20, 2011
        • {It sounds like she is part of YouTube}
        • My name is Colleen, I am the engineer at Google who wrote these specs and is working hard to make ingestion into YouTube in extremely high quality much easier.
        • Thanks for the feedback :).   As to the the bitrates seem excessive, that is being explained in the next revision of the specs. I swear there is a reason!  The key is to think of what you upload to youtube as your golden master, not just a means to today’s end. When a file is uploaded to YouTube, we treat it as a mezzanine file. From there, we create all of the necessary formats and bitrates for delivery to viewers on every platform and network condition. Having better quality as a mezzanine file, allows us to improve the output quality here.  Even cooler than that though, is we can use the mezzanine file to re-output new deliverable formats at a later date. Since devices and network connections keep getting better, as well as cool new codec technology like WebM, YouTube can keep your content looking fresh and up to date for years! High bitrate master files will keep you looking awesome while others dont age as well 🙂
    • http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC
      • H264 and its settings
    • http://www.slideshare.net/cehis/encoding-h264-video-for-streaming-and-progressive-download
      • {A vast treasure-trove of deep tech info, hints & tipe on H264 concepts etc.}
      •  Typical B-Frame EncodingParameters: [Number] is number of B frames between I and P-Frames; (IBBBPBBBPBBBPBBBP)  3 is recommende
        • But Colleen of Google recommends for YouTube Enterprise-class uploads it should be 2.
      • CABAC (Context-adaptive binary arithmetic coding).  More efficient (e.g. better quality), but harder to decode.  CAVLC (Context-adaptive variable-length coding).  Less efficient, easier to decode.   In challenging scenes at low data rates, CABAC was noticeably better. Most authorities place quality advantage at 10-15%.
    • http://www.eventdv.net/Articles/ReadArticle.aspx?ArticleID=80446
      • Tutorial: Encoding H.264 Video in Adobe Media Encoder CS5.5 and Apple Compressor 4
        • By Jan Ozer – Posted Feb 6, 2012
      • Very visual article on Adobe Media Encoder’s interface.
      • Contains a Table showing that H264 Mode [High] implies (among other things): CABAC Entropy-Encoding, 2 B-Frames (means between each I & P frame)
      • Says <<Adobe Media Encoder is faster and produces higher-quality output than Apple Compressor 4.>>
        • {Kind of academic nowadays…}
    • http://philipbloom.net/forum/threads/keyframe-settings-for-encoding-h-264.11330/
      • Matt Davis, Apr 25, 2013
        • When you’re sending stuff to Vimeo or YouTube (in fact, most online video services), the video you send them is NOT the video you’re actually watching. These services use the movie you’re sending them to encode their own copy (or ‘copies’ – different resolutions, different quality levels). So you should be sending them the BEST quality you can – to the extent that the quality is SO HIGH YOUR COMPUTER MAY NOT PLAY IT BACK SMOOTHLY.
        • Both services request that you use not “Baseline”, not “Normal” but “High” profile encoding. The High profile makes many more demands on the processor to decode it, but packs more info in a smaller space.
        • If you film at 24 or 25fps, bear in mind that computer screens are, by and large, 60Hz devices, and 24 or 25 into 60 isn’t the cleanest of frame rate divisions – which leads to some stuttering on computer screens. If I play back a 25fps movie from Vimeo on a computer screen, it’s good – but not quite ‘buttery’. If I play the same Vimeo back on my UK AppleTV on the family TV, which are all set for 50Hz, it’s absolutely superb. So, I tend to lean towards 30fps for web based or screen based projects that won’t mind the slightly more ‘slick’ look.*
        • Adobe Media Encoder isn’t the sharpest pencil in the box when it comes to H.264 (and neither is Apple’s Compressor – but my solutions won’t be popular – Episode Pro with the x264 encoder isn’t exactly cheap).
        • Rough rule of thumb: Baseline = phone/iPad, Normal (sic) = Playback on average Macs/PCs, especially in PPT/Keynote, High = Edit ready, mastering.
        • Vimeo and YouTube, in their upload fineprint, suggest 5-10 Mbits per second High profile H.264 using standard IBP structure, with audio at 384 (or thereabouts) kbps.

Comments are closed.