Encoding YouTube Videos at the Highest Quality
With over one billion users and more prime demographic reach than any major television network, YouTube is a distribution channel you don’t want to miss out on. From codecs to bit rates, this in-depth look at the best way to encode your videos for YouTube can help you become a YouTube encoding expert.
Your video production is finally ready for the world to see. You’ve spent hours fine-tuning your edits, dialing in your color grade, and mixing your sound track. When you upload your video to YouTube, you want it looking its best. But what compression settings should you use? Which file format should you export your video to, and what bit rate will give you the highest video quality, while still playing back smoothly online?
When you know what’s going on behind the scenes, you’ll understand the best settings to use and why you should use them.
Advertisement
To answer these questions, it helps to know how YouTube processes your video once itâs been uploaded to its video servers. When you know what’s going on behind the scenes, you’ll understand the best settings to use and why you should use them.
Mục lục
Inside YouTube
When you upload your video to YouTube, its video servers kick into action and start transcoding your file into a set of optimized video streams. This allows your video to playback smoothly on everything from mobile phones to desktop computers. The individual video streams range in resolution and video quality from tiny postage stamp sized videos, all the way up to 1080p and 4K.
The important thing to remember is that anything you upload to YouTube will be transcoded. You don’t want to upload a highly compressed, low bit rate video. It’s just going to get compressed again. Instead, you always want to upload a high quality video to YouTube.
Codecs in Use at YouTube
So what video format does YouTube transcode your video to? Maybe you can match its settings and keep it in the same format so your video doesnât need to be transcoded. Well, thatâs a good idea, but it doesn’t exactly work that way. For starters, YouTube uses more than just one codec, and each codec is encoded to multiple resolutions and bit rates.
H.264 is the codec used by most of YouTubeâs video streams right now, but there are also other codecs in use such as VP8. Some codecs are still in use for compatibility with older cellphones, and newer codecs such as VP9, are used to deliver 4K content.
Video Formats Accepted by YouTube
You can upload just about any kind of video to YouTube, from the video you just shot with your mobile phone to your latest 4K video production. YouTube’s list of supported video formats includes MOV, MP4, AVI, WMV and many others. You may be surprised to find out that YouTube will even accept high quality video formats like ProRes, DNxHD and uncompressed 10-bit HD video.
Now, just because you can upload uncompressed HD doesn’t mean you should. For one thing, it will take a lot longer to upload your file. But even if time isn’t an issue, there are a few conversion details you have to watch out for. If you’ve got an interlaced HDV timeline, for example, you don’t want to just export a movie and upload it. First you need to deinterlace the video, scale it to the right resolution, and decide how much time you want to spend uploading it.
Quality Versus Upload Time
If video quality is your number one priority, then by all means, upload ProRes, DNxHD or uncompressed HD video files. You’ll get fewer video compression artifacts on YouTube when you upload high quality video formats, as opposed to low bit rate files. So if you’ve got the time, upload the best video you’ve got. At some point though, the visual difference between a ProRes file and an uncompressed file is indiscernible, the only real difference being file size. So donât spend more time uploading than you have to.
If time is of the essence, an H.264 or H.265 video with the MP4 file format is the way to go. This is YouTube’s recommendation. Keep in mind however, that whatever you upload to YouTube is locked in. You can’t change out the file to increase its video quality later on without also losing your viewer count information along with any links to your movie. The best you can do is remove your video entirely and upload a new one.
If YouTube starts using a new codec like VP9, they’ll transcode your video using your original upload. If you uploaded an H.264, that’s as good as it’s going to get. But, before you go running off to upload all of your uncompressed HD 1080p files, there are a few things you’ll want to keep in mind.
File Size and Duration
You’ll need to keep an eye on the file size and length of your video. With a standard account, the video you’re uploading to YouTube can’t be any more than 15 minutes in duration. If your video is longer than that, you’ll have to get your status verified, or split your video into shorter pieces.
Verifying your account status is fairly straightforward. You’ll need to enter your mobile phone number, and as long as your account is in good standing, you’ll be sent an activation code that will allow you to upload longer videos. Once you’ve verified your account, you’ll need one of the very latest Web browsers if you’re going to upload anything that’s more than 20GB in size.
Getting the Format Right
Anytime your video doesn’t match the video stream YouTube is trying to encode, YouTube will have to do a format conversion. The simplest example is resolution. YouTube starts with your HD video and then scales it down to each of the smaller resolutions it will be streaming.
If your editing format is already progressive, with one of the recommended square pixel resolutions, then you can just export your timeline and start uploading your file immediately. For example, if you’re exporting a progressive ProRes 1080P timeline, then you’re good to go. If your editing format doesn’t match, for example, if your timeline is interlaced or it’s using a non-square pixel aspect ratio like DV, then you’ll have to do a format conversion by exporting a new video file.
Resolution and Pixel Aspect Ratio
You want all of your videos to have a square pixel aspect ratio when you’re uploading them to YouTube. For SD 4:3 video, use a resolution of 640×480. For SD 16:9 widescreen video use 854×480, and for HD video use either 1280×720 or 1920×1080.
Frame Rates
The general rule of thumb here is to encode and upload your content in the same frame rate it was recorded. In most cases, this will be 24 or 30 frames per second in North America, and 25 or 50 in Europe. However, YouTube supports pretty near any frame rate you can dream up. The most common rates are 24, 25, 30, 48, 50 and 60 frames per second, but youâre not limited to those. The easiest way to create content with a correct frame rate is to have your project settings match the footage you ingest, and when you encode, choose a preset that will match your project settings.
Now, to deal with the i and the p.
The video you upload to YouTube should be progressive. While interlaced footage is becoming scarcer by the minute, it does still exist and many modern cameras still offer an option to shoot interlaced footage.
If your timeline is interlaced, be sure to deinterlace the video when exporting. For example, selecting motion compensated deinterlacing in Appleâs Compressor will result in significantly longer render times but can produce far better results.
An example of proper deinterlacing prior to uploading would be to take 1080i60 content and deinterlace it to 1080p30, swapping 60 interlaced fields per second to 30 progressive fields per second.
Bitrate
YouTube includes some recommendations for bitrates, and they vary pretty substantially, depending on the resolution of the video youâre looking to upload.
For 4K video (2160p) at standard frame rates (24, 25, or 30 frames per second), the recommendation for SDR (standard dynamic range) uploads is 35-45 Mbps and 53-68 Mbps for high frame rates (48, 50 or 60 frames per second). For that same size but as an HDR (high dynamic range) upload, the recommendations are 44-56 Mbps at standard frame rates and 66-85 Mbps at high frame rates.
There are recommended settings for a handful of other resolutions, from 360p through 2k and 4k, both for SDR and HDR uploads. Hereâs a chart to determine your ideal bitrate:
For audio, the recommended bitrates are 128 kbps for mono, 384 kbps for stereo and 512 kbps for 5.1.
Codec
To reiterate, you want to use the highest quality codec you can. If your timeline is ProRes, but it’s interlaced, you don’t have to export an H.264. Instead, you can deinterlace to a ProRes file on export and maintain your image quality. The only reason to export an H.264 is to make the upload and processing speeds faster. But remember, once your file is uploaded, it’s locked in and you can’t change it. It may be worth a few more hours of upload time if your video is going to remain online for years to come.
Tools of the Trade
There are a few tools every editor should keep handy for encoding files, or re-encoding files that have been delivered to us in a format that YouTube wonât like.
Handbrake is an excellent tool for encoding and re-encoding. It can handle some truly rare and obscure file formats and create usable MP4 files out of them.
Other great options include the renowned ClipWrapâs heir apparent, EditReady. This product by Divergent Media does an excellent job of encoding files, wrapping files and more. It can take segmented footage â cameras break up long files in accordance with their storage mediaâs file size limitations â and seamlessly stitch it back together before you ingest said footage into an editing application.
A reliable solution that has been around for quite some time is MPEG Streamclip. This tool offers a wide array of output formats, and itâs quick and intuitive.
Encoding canât be brought up without mention of Adobe Media Encoder CC 2017. This is the latest version of AME out of Adobe, and itâs faster, more reliable and â thankfully â more stable than ever. Past versions had a few ghosts in the machine, but 2017 seems to be a rock solid release. This application has more presets and output formats than just about any other program, including a handful of YouTube presets that will make your encoding decisions easy.
Of course, your editing application will have options for encoding as well. Investigate those thoroughly before looking to an outside encoding application.
The Bottom Line
These are a few of the variables that can be played with to encode your video perfectly for YouTube. Master a few of these settings and youâll be able to capture, edit and encode your content without worrying about the final destination. Well-captured 16:9 progressive footage edited in a timeline that matches the settings of the footage, encoded into a final file that suits YouTubeâs recommendations while matching the timelineâs frame rate and resolution settings will yield an excellent result every time.
Try creating some practice content, test out the presets in your editing application or create your own optimized presets, and make this part of the process second nature, so you can get back to concentrating on making the best content possible.
SIDE BAR: YouTubeâs Recommendations at a Glance
Want to save yourself 2,000 words and just get straight to the good stuff? Not a problem. Here are YouTubeâs recommended settings for file uploads at a glance:
- Container: MP4 with no edit lists.
- Audio Codec: AAC-LC in stereo or stereo + 5.1 with a sample rate of 96khz or 48khz.
- Video Codec: H.264
- Frame Rate: The same rate the video was captured at.
- Bitrate: no fixed bitrates required, but there are recommendations in the bitrate section of this article.
- Resolution and aspect ratio: 16:9 aspect ratio at your preferred resolution.
Now, a few points about the above. First off, YouTube is the big dog on campus when it comes to video platforms, so all of the major editing applications have output presets that will match YouTubeâs recommendations. So, donât get nervous if thereâs a term or two you donât understand. In most cases, if your footage was captured and edited properly, youâll be able to select a YouTube preset output and youâll be ready to upload.
To find the YouTube presets in your video editing application, look among the render settings when the time comes. Premiere Pro, Final Cut Pro X, Avid Media Composer and the rest of them (including iMovie and MAGIX Vegas Pro) will have H.264 output presets that are specific to YouTube.
Russ Fairley is a video producer and motion graphic designer, who can be found behind a drum kit when heâs not in the edit bay.