FFmpeg: How to Change Resolution of a Video File

Updated

Learn how to change the resolution of a video file using FFmpeg

FFmpeg: How to Change Resolution of a Video File

Before starting, make sure you have FFmpeg installed on your computer and open your command line in the folder containing your video.

To scale your video's height to 720p while automatically adjusting the width, run this command:

ffmpeg -i input.mp4 -vf scale=-2:720 output.mp4

In this command:

  • -i sets your original video file.
  • -vf scale=-2:720 changes the height to 720 pixels.
  • Using -2 for the width automatically keeps the correct aspect ratio while making sure the pixel dimension is an even number (which prevents encoding errors).

Depending on the size of your video and your system speed, processing might take anywhere from a few seconds to a few minutes.

Once the command finishes, open output.mp4 in your media player to confirm that the video plays properly and looks sharp.

If anything goes wrong, always keep your original input.mp4 file as a backup in case you ever need to export at a different resolution later.