How to reduce video file size

Video files can be very large in size. We have created 10 minute videos that take up 500MB of disk space, when recorded at 4K resolution and the video content is dynamic. When video content is dynamic (changing a lot), video compression does not work so well, resulting in large files.

The Problem

Large files can take minutes or hours to upload and use up space on your computer. Nowadays, a number of people are working remotely and creating videos for work. They are running into problems due to the large file sizes.

This article gives a solution for converting a large video file to a smaller video file, on your computer. There is no free lunch and the file size reduction will come at the cost of video quality. Still, our approach will work for most people.

The Solution

We will be using a free software called ffmpeg, that is widely used for programmatic video editing.

  1. Download the ffmpeg .zip file from this link:
1. Select the release version (v4.2.2 at the time of writing) 2. Select your operating system 3. Click ‘Download Build’

2. Unzip the ffmpeg zip file. The ffmpeg executable is located in the bin folder of the unzipped file.

3. Open the Terminal application and cd (change directory) to the path of the ffmpeg executable.

4. Copy and run the following command in the Terminal application. Replace input.mp4 and output.mp4 with the full path of the input and output video files respectively.

ffmpeg -i input.mp4 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -pix_fmt yuv420p -an -preset slow -crf 28 output.mp4

The crf value shown in the command above is the compression factor. A lower crf value reduces video quality and results in a smaller file size. Adjust the crf value till you get an output file that is of suitable size and acceptable video quality.

The above steps might be challenging the first time, but if you learn them once, you can enjoy a lifetime of fast video uploads and computer storage savings.