How To Encode H.264/MPEG-4 Videos for Video Sharing

Share on

These guidelines will ultimately present a compromise between maintaining a small file size (less than 100MB for Youtube) and maintaining as much original information from the video content itself as possible to ensure the highest quality result. While this is our recommendation specifically for encoding for use on Youtube, these settings should be good overall for most other video sharing sites as well.

  1. We recommend that you use the H.264 codec, the best MPEG4 codec in the market today.
  2. Set quality option to “best”
  3. Set rate control to 1-pass CBR (Constant Bit Rate). Youtube transcoders prefer CBR so forget about Variable Bit Rate.
  4. For key frames, set them to every 30 frames or less. The more keyframes the better as it will offer more information and Youtube transcoders love keyframes. However, keep an eye on file size.
  5. We recommend that you set the bit rate to 1500 kbps or more, depending on the time/length of your video. Just like with keyframes, keep an eye again on file size. You should be good setting this to as high as 2000kbps for shorter length video clips.
  6. As far as resolution and aspect ratio, Youtube resizes your video upon upload to 320×240. Rather than having your video be resized by Youtube, which uses bicubic, bilinera method, use your compression software as it likely has a better algorithm for resizing the aspect ration.
    1. If you are working with video content that is 16:9 (widescreen), you have 3 possible options:
      1. Let YouTube letterbox your 16X9 videos automatically. Our recommendation would be to do this prior to uploading to Youtube, see below.
      1. Pan and scan – Fit the height of your video inside the 4:3 viewport, then crop off the excess left and right sides.
      2. Letterbox – Fit the width of your video inside the 4:3 viewport, then put black bars above and below your video to keep it centered vertically.
        1. There is a great post here that will show you in-depth instructions for resizing your widescreen videos for fitting within a 4:3 players.
  7. You probably don’t need us to tell you this, but set the frame rate to 30 fps.
  8. For audio, set the compression to MP3 or AAC, with 44.1KHz, 64kbps, 16bit, mono.
  9. Make sure you de-interlace your video if there is a lot of motion.
  10. Use brightness, contrast, and sharpening filters to enhance the look of your video.

Other Great Resources:

  • Creating Video Content with H.264
    QuickTime 7 Pro makes it really easy to create stunning video with the new H.264 video codec in QuickTime 7.
  • FLV CompressionThis article features some tips and tricks for compressing and delivering video to the web.
  • Poking at YouTube
    Read this article on how YouTube might be doing its Flash server encoding.
  • Formats for Youtube
    This wiki page keeps a log of all the video formats that are acceptable for Youtube as well as the ones that failed upon upload.


Video Industry

Share on

Read More Insights

©2022 Tubular Insights & Tubular Labs, Inc.