How To Encode Your Videos For YouTube’s New High Quality Option

You Tube

*******************************************
UPDATE 12/6/2008

If you are producing HD (16:9) videos for YouTube, you should refer to my latest post on how to encode for YouTube HD format located at:

http://webvideotechniques.com/123/bigger-and-better-encoding-for-youtube-hd

*******************************************

Now that YouTube have started offering higher quality videos, the old settings for encoding your videos should be tossed out the window. This tutorial will walk you through the steps required to compress your video for YouTube using the free SUPER Video Encoder which is one of the the best free encoding applications available today. If you are using a professional software like Sorenson Squeeze or Apple Compressor, or even the inexpensive QuickTime Pro Player, many of the same settings will be available. Additionally, if your editing software supports H.264 (as either MP4 or MOV) encoding, you may be able to skip the reencoding process and export directly for upload to YouTube using the compression settings below. If you are unsure of the equivalent setting or would like me to include specific instructions for your application, please leave a note in the comments.

This tutorial assumes that you already have edited your video and have exported to the highest quality possible.

Here are some tips for exporting from your NLE software before encoding:

  • Export uncompressed video and audio as MOV or AVI
  • Make sure your video is progressive/deinterlaced
  • If your video is SD NTSC, then export as 640×480 (if you are using PAL you will need to crop first)
  • If your video is HD or 16:9 widescreen, export as 640×360
  • Use 44.1KHz Sample rate to avoid audio quality issues

The current high quality resolution on YouTube is 480×360 (4:3 SD) and 480×270 (16:9 Widescreen). During testing I found that uploading a 640×480 (4:3 SD) or 640×360 (16:9 Widescreen) produced a higher end data rate even though YouTube downsizes the resolution during encoding. Using the larger resolution (and data rate) source file also future-proofs your video if they decide to raise the quality level again in the future. That way you do not have to re-upload later if they change the size/quality. Now that they are allowing up to 1024MB (1GB) for uploads, there is plenty of room to go with the higher resolution version.

I downloaded a few of the new high quality videos and most have been approximately 400-500kbps Video and 120kbs for the audio, a nice bump up from the 250-350 combined data rates for the lower quality. One of the reasons that they look so good is due to the fact they are using the new H.264 codec in a MP4 wrapper for the video and AAC audio. The H.264 codec is the de facto standard for high quality video on the web today and the older Flash codecs Spark pro and On2 VP6 just can’t deliver the same quality level vs filesize at the same data rates.

Our goal is to upload the highest quality possible that will take full advantage of the current high quality video encoding as well as give us some headroom for future quality increases.

Enough with the details, just give me the encoding settings!

  1. Open SUPER and import your source video. Make sure you do not change any default settings except for the ones noted below.
  2. Set Output Container as: MP4
  3. Set Output Video Codec as: H.264/AVC
  4. Set Output Audio Codec as: AAC LC
  5. Under Video Scale Size, check the More box and enter 640 : 480 (4:3) or 640 : 360 (16:9 widescreen)
  6. Set Aspect to 4:3 for SD or 16:9 for HD/Widescreen
  7. Set Frames per Second to 29.97
  8. For Bitrate kbps, choose 4080
  9. IMPORTANT: Depending on the amount of movement and color in your video, you may need to raise the bitrate. During testing using a clip with a lot of motion, 4080 provided the best end results. If the video you export has blocks or artifacts, then you may try raising the bitrate to 5000kbps.
  10. Make sure “Hi Quality” selected BUT NOT “Top Quality”
  11. Uncheck 48k Audio
  12. Select a Sample Rate of 44100
  13. Set the channels to 2
  14. For Bitrate kbps, select 256
  15. Click the encode button to encode your video

Below is a screenshot of the SUPER interface with all of the correct settings:

Here is the equivalent settings in Sorenson Squeeze 5:

With the video that I used for this tutorial, I found that if I uploaded a video that was less than 4080kbps, then the end bitrate after YouTube encoded it was lower and if I raised the bitrate to higher than 4080kbps, then the end bitrate was the same as it was when I used 4080kbps.

Here are some details from my tests:

640×360 @ 3000kbps, end result was 480×270 @ 439kbps
640×360 @ 4000kbps, end result was 480×270 @ 501kbps (Sweet spot)
640×360 @ 5000kbps, end result was 480×270 @ 501kbps

For audio, the bitrate capped out at 124kbps.

Here is the final video (High Quality version) on YouTube (http://youtube.com/watch?v=ePOV7CWpLSA&fmt=18)

(Special Thanks to My Digital Life for the tip on how to get the embed code to show the high quality version)

If you have any questions or tips for encoding high quality You Tube videos, please post in the comments. Also, if you used these settings to encode your video(s) for YouTube, post links to your videos.

9 Comments

  1. Mokona
    Posted August 30, 2008 at 3:06 am | Permalink

    What should the settings be when I export from for instance AE og premiere?
    And what settings should I use if I’m exporting to vimeo (in SUPER)?

    Thanks.

  2. VideoPro
    Posted August 30, 2008 at 3:47 am | Permalink

    @Mokona - Is your project SD or HD? In AE or Premiere, you can probably get away with just exporting directly to the file you will upload to YouTube at 640×480 or 640×360 (16:9). I would recommend very similar settings as are in the tutorial. For example, when you export from AE, add your comp to the render queue and select QuickTime as your output format, then click on the settings button and choose the H.264 codec, set keyframe every to 30 frames, limit data rate to 3000kbps and slide the quality slider to best.

    For Vimeo, since they allow up to 1280×720…depending on the length of your video and the speed of the motion, you may need to up your data rate to 5000 - 7000kbps. If your video is only SD, then use the guidelines for YouTube. Here is a good link for Vimeo compression tips: http://www.vimeo.com/help/compression

  3. Mokona
    Posted August 31, 2008 at 11:15 am | Permalink

    For the 30 frames keyframe, that would be for every 25 frame for me since I live in Europe right (working with PAL @ 25 frame).

    Thanks for the response :)

  4. VideoPro
    Posted September 1, 2008 at 3:35 am | Permalink

    @Mokona - Yes, set your output file to 25fps and also set the “keyframe every” setting to 25 as well. This will ensure a keyframe will be created at least every 1 second, although you do not have to set this to be equal to your keyframe. You could set it at any number you wish. The lower number you enter, the higher the quality at the expense of larger filesize. Since the video will be reencoded by YouTube, there is no reason not to set this to your FPS rate or less. For very fast motion, you could even set to 10 or 15.

    Usually, when I am encoding a file to be displayed on the web (not to be reencoded like YouTube) I will start with setting the “keyframe every” to 2 times the FPS. For a 30fps video, I would set to 60 and then reduce as needed.

  5. MindJuiCeS
    Posted December 16, 2008 at 2:53 pm | Permalink

    I used all the settings as posted, and when I watch the video after its done encoding, the video quality looks way worse than the original, and the audio is out of sync. What am I doing wrong?

  6. VideoPro
    Posted December 17, 2008 at 12:36 pm | Permalink

    @MindJuiCeS - Way worse than the original YouTube or Source video? What application did you use to encode? Please post details about your source video’s resolution, codec and data rate. You can use MediaInfo (http://mediainfo.sourceforge.net/en) on your Source file and the file you encoded and post the results here or send to my email (webvideotechniques@gmail.com)

  7. ExtremeVision
    Posted December 22, 2008 at 5:19 am | Permalink

    Hi, i shot a video and edit in premiere cs3 my original footage is 16X9 widescreen 720X480 24p. I have been trying for months to get the best quality video in normail mode for youtube, and it’s just very bad, but i did get the hd part it works good, i just want it to look good at least in normal mode, please help?

  8. Posted January 2, 2009 at 7:47 pm | Permalink

    Hey, I’m trying to get as good audio quality for Youtube (using Flash CS3 and Samplitude vs8) as my original vinyl recording is, and Flash CS3 Bible says it’s better to use mp3 rather than wav, if I understood right. Is that really so? Is there any books or articles about it, step by step tutorials, as insomnia makes this all so slow.

  9. VideoPro
    Posted January 4, 2009 at 1:15 pm | Permalink

    @Kyky, when encoding for YouTube, I would recommend AAC at 256kbps. If you do not have access to AAC codec, then MP3 will work. In your projects, you should use either WAV or uncompressed audio to preserve the quality for different output formats.

Post a Comment

Your email is never shared. Required fields are marked *

*
*