video compression

How to compress a video for internet?

Reduce size without loss in quality. If you’re using a professional NLE, then I recommend you compress your video from it.

If you don’t have access to professional tools, use Handbrake. Well, actually, even if you have professional tools, try it – sometimes it does better.

 

Youtube and Vimeo settings

What does Youtube and Vimeo have to say? First, check out their specifications:

Youtube Advanced Encoding Settings

Vimeo Video Compression Guidelines

 
In the case of Youtube, they recommend a minimum of 8 Mbps for 1080p videos, but would prefer 50 Mbps if you have the Internet connection to swing it.

In the case of Vimeo, they recommend at least 10 Mbps for 1080p, and ideally 20 Mbps if you can swing it.

The question is: Can you swing 10 Mbps or more? Most consumer Internet connections have fast download speeds, but slow upload speeds. At 4 Mbps upload, you will need to wait for 2.5 times the video duration for your upload to complete (assuming your video is compressed at 10 Mbps). What if your video is compressed to 20 Mbps? A five minute video being uploaded at 4 Mbps will take 25 minutes and will be 750 MB. A five minute 50 Mbps video will take an hour to upload and will be about 1.8 GB. A 50 Mbps video that is an hour long will take about 2.5 days and be 110 GB.

A slower Internet connection means more time to upload. If your video is really important, that’s what you should aim for. Look at your limitations, and work backwards. Don’t compromise quality by being in a hurry.

Okay, so why did I say 20 Mbps might not be good enough?

Youtube and Vimeo will further compress your videos if they see fit. You usually have no choice in this regard. I’ve found they further compress your videos by half. E.g., 1080p videos tend to become 5 Mbps and 720p videos tend to become 2.5 Mbps or so. It’s their ‘secret sauce’, which ruins our recipe! I mean, isn’t it easier for them to tell us to encode at their preferred data rate and let us manage the compression? We’re doing it anyway, right?

Here are some other settings to look out for:

Progressive scan (no interlacing) only. Leave interlacing to broadcasters.

Color bit depth is 8 and chroma sub-sampling is 4:2:0. Color space is Rec. 709, though it should be sRGB (the differences are negligible so don’t worry about it).

High Profile H.264 instead of Main Profile.

2 consecutive B frames, which means a keyframe every third frame.

Closed GOP. GOP of half the frame rate. Choosing the keyframe or I-frame frequency lets you control this.

CABAC – it’s just another level of coding that gives you better quality, but takes more time to encode.

Variable bit rate if possible, though I highly recommend Constant Bit Rate (CBR) if you don’t care about the file size.

Audio is AAC-LC, sampled at 48 KHz, at 384 kbps (stereo) or better.
 
As far as data rate is concerned, try your best to go as high as possible, with 50 Mbps being the benchmark. If your data rate is lower than this, you lose control over your quality. You should always test your videos in small chunks – don’t get lazy.