Context Navigation

How to Encode Videos for YouTube and other Video Sharing Sites

Since YouTube, Vimeo, and other similar sites will re-encode anything you give it the best practice is to provide the highest quality video that is practical for you to upload. Uploading the original content is the first recommendation, but this is not always a choice due to file size or bandwidth limitations, so re-encoding may be required. This guide will show you how to create a high quality video using ffmpeg.

First read the FFmpeg and x264 Encoding Guide; specifically the section on CRF. The examples below use the same method as shown in the encoding guide but optimized for YouTube.

Basic Examples

Re-encode the video and stream copy the audio. The output should be a similar quality as the input and will hopefully be a more manageable size.