Sunday, January 29, 2012

Squeezing the most out of H.264 QuickTime


Presumably you already know about keeping the native resolution, aspect ratio,
frame rate, interlacing, etc., taking into account the final delivery format.

At this point it's worth repeating that Vimeo allows "Plus" users to download
each other's raw upload file ("raw" as in what got uploaded to the site). This can
be any .MOV or .MP4 you wish, getting around the 30fps limits of "online video".

How to get the most quality out of your QuickTime encoding:
   
  • Most importantly, install an x264 implementation encoder.
    It still decodes with Apple / VLC / MPlayer / etc.

    http://www.macupdate.com/app/mac/20273/x264-quicktime-codec

    This is Henry Mason's x264 implementation.  After extensive trial and error,
    I've found it more effective than the 'lavc' implementation, with far fewer buttons.

    Here's what I mean:
The 'lavc' x264 options panel.  Thankfully, we can avoid this.


  • Advanced Settings:

    This is simply a question of DB or not DB.  Deblocking is the pre-filtering
    craze that makes people with a semi-trained eye believe they have conquered
    the MPEG quality issue.  "No More Blocky Pixelization!"

    Unfortunately, it's also a killer of HD.  With time, you'll come to appreciate
    that deblocking kills the "oversampled" pixels which make the best HD film
    transfers, or classy 4K to HD content.  Indeed it can take away the full
    potential of SDTV (the best SD is always produced in HD).

    If you come across a high bitrate MPEG-2 source, you'll notice the lovely detail
    in the noise which really isn't noise at all.

    If your video feature contains grains, rocks, forests, or textures of any kind,
    then turn off DB.
      This is the key to ensuring that the feel of the video does not
    change … it is the only setting that has a real impact on changing the nature of
    the picture.  This sets it apart from the amateurish look of archive-unfriendly
    codecs like Cinepak, DiVX and Xvid, historically abused by "the scene".
    x264 Advanced Settings:  No DB
    Turn on CABAC (the real grunt behind H.264) and everything else, except B-frame
    Pyramids:  All the others put a burden on the
     encoder (you) and not the decoder;
    the random forward-lookup nature of the B-frame pyramids 
    means you would be
    placing an undue burden on the viewer, whose Pentium III 
    clunky laptop probably
    can't cope with the decoding.


    If your video feature contains mostly glossy surfaces
    blue sky, cloud or water,
    then use DB.  Set it to maximum.
     These are examples of where DCT technologies
    come up short;  the MPEG family will try to be "faithful" to the noise but in our minds
    we want to see the smoothness of these surfaces.
    x264 Advanced Settings:  DB Max
      
  • Aiming for a bitrate?  Use 2-pass and turn off the frame resampling.
    Of course, if you're aiming for a bitrate, you'd use "Restrict to" and enter kbps!

    There's a big fat bug:  If you don't select "Current", the 2-pass encoding won't hit
    your target;  instead it will just give you a "medium" quality encoding, regardless of
    the target bit rate, spatial quality percentage and temporal quality percentage.
     
  • Generally, though, you're not aiming for a bitrate.  You would be:

    1.  Uploading a short YouTube feature that doesn't go near the 20GB "pro" limit
    2.  Uploading a very short Vimeo feature that doesn't go near their 5GB limit
    3.  Uploading a low-resolution or sub-15-min YouTube clip;  you're going to be
         nowhere near the 2GB "amateur" limit, just wanting a quicker upload than
         you'd get if you uploaded the original source — without losing too much quality

    In this case you should set the Data Rate to Automatic, and select one of the following
    for Spatial Quality (temporal quality is ignored):
     
    • 50% Medium for "looks good to most people"
      (equivalent to bit-starved broadcast quality)
    • Halfway between 50% Medium and 75% High "looks good to pros"
      (equivalent to a typical DVD or BluRay)
    • 75% High only if you really need to maintain existing artefacts
      (e.g. for another generation of editing)
    • Halfway between 25% Low and 50% Medium for just scraping by
      (e.g. if you had a really bad source anyway,
      and just need some further bitrate reduction)