Convert Video from 1080p to 720p Using ffmpeg

Sometimes we need to upload or send someone a video file. A 1080p video file will be extremely large, so it’s more convenient to downscale it to 720p.

To convert a video file from 1080p to 720p, use the very versatile ffmpeg tool:
ffmpeg -i input.mp4 -vf scale=-1:720 -c:v libx265 -crf 20 -preset fast -c:a copy output.mp4

The resulting H.265 video encoded by the libx265 encoder offers around 25-50% bitrate savings compared to an H.264 video encoded with libx264,

If you also want to change the audio encoding, you need to change the command slightly:
ffmpeg -i input.mp4 -vf scale=-1:720 -c:v libx265 -crf 20 -preset fast -c:a aac output.mp4

The aac encoder is the default one implemented in ffmpeg. It will set the audio bitrate to 128kbps by default.

In case you want to set the audio bitrate higher, use:
ffmpeg -i input.mp4 -vf scale=-1:720 -c:v libx265 -crf 20 -preset fast -c:a aac -b:a 320k output.mp4

As for which codecs to use, this entirely depends on where you wish to play back the video. It’s best to check your device’s documentation regarding codec support and choose one which is listed there.

ffmpeg provides detailed documentation for its internal codecs.

Leave a Reply

Your email address will not be published. Required fields are marked *