How to Resize Videos Easily Using FFmpeg: A Step-by-Step Tutorial for Beginners

Resizing videos can seem like a daunting task for beginners, especially when faced with unfamiliar command-line tools. However, with a little guidance, it’s surprisingly easy to achieve professional results using FFmpeg, a powerful open-source multimedia framework. Whether you’re trying to reduce video file size for faster uploads, adjust resolution for mobile devices, or match a specific display format, FFmpeg offers the flexibility you need in just a few simple commands.

This tutorial will walk beginners through the step-by-step process of resizing videos using FFmpeg. With basic commands and practical examples, even those new to video editing will feel confident using this tool. Let’s get started!

What Is FFmpeg?

FFmpeg stands for “Fast Forward Moving Picture Experts Group.” It’s a command-line-based software suite for handling video, audio, and other multimedia files. It supports almost every format imaginable and is widely used by developers, content creators, and video editors for tasks such as video conversion, trimming, compression, and resizing.

Why Resize Videos?

There are many reasons why someone might want to resize a video:

  • Reduce file size for uploading to websites or sharing via email
  • Optimize resolution for mobile or tablet playback
  • Match a specific screen aspect ratio for social media or presentations
  • Create thumbnails or preview clips

Installing FFmpeg

Before resizing your video, you’ll need to install FFmpeg. It’s available on all major operating systems:

  • Windows: Download the static build from the official FFmpeg website. Extract it and add the bin folder to your system’s PATH environment variable.
  • macOS: Use Homebrew with the command brew install ffmpeg.
  • Linux: Most distributions offer FFmpeg in their software repositories. For example: sudo apt install ffmpeg for Ubuntu.

Finding Out the Original Video Resolution

Before choosing a new size, it helps to know the original dimensions. Run:

ffmpeg -i input.mp4

Look for lines that contain the video stream details, such as:

Stream #0:0: Video: h264, yuv420p, 1920x1080

In this example, the original resolution is 1920×1080 (Full HD).

Basic Command for Resizing a Video

To resize a video, use the -vf scale filter in this format:

ffmpeg -i input.mp4 -vf scale=width:height output.mp4

Here’s a practical example that resizes a Full HD (1920×1080) video to HD (1280×720):

ffmpeg -i input.mp4 -vf scale=1280:720 output720p.mp4

Preserving Aspect Ratio Automatically

If you want to resize by setting only the width or only the height while preserving the aspect ratio, use:

ffmpeg -i input.mp4 -vf scale=1280:-1 output_resized.mp4

In the above command:

  • 1280 is the desired width
  • -1 tells FFmpeg to automatically calculate the height while maintaining the original aspect ratio

Common Resolution Sizes

  • 4K: 3840×2160
  • Full HD: 1920×1080
  • HD: 1280×720
  • SD: 640×480

Make sure you choose dimensions that match your end-use case. For example, 1280×720 is perfect for YouTube or mobile playback, whereas 640×480 might suffice for quick email sharing.

Batch Resizing Multiple Videos

If you want to resize multiple videos in a folder, you can use a script. Here’s an example shell script for Linux/macOS:

for file in *.mp4; do
  ffmpeg -i "$file" -vf scale=1280:720 "resized_$file"
done

This command will go through all .mp4 files in the directory and create resized versions with the prefix “resized_”.

Controlling Video Quality with Bitrate

Resizing alone might not significantly reduce file size. If you need smaller files, consider reducing the bitrate during resizing:

ffmpeg -i input.mp4 -vf scale=1280:720 -b:v 1000k output_compressed.mp4

This command resizes the video and sets the video bitrate to 1000kbps, helping decrease file size further.

Add Padding to Avoid Distortion

If resizing causes distortion due to aspect ratio mismatch, you can use padding to fix it:

ffmpeg -i input.mp4 -vf "scale=640:480:force_original_aspect_ratio=decrease,pad=640:480:(ow-iw)/2:(oh-ih)/2" output_padded.mp4

This command fits the video within 640×480 and adds black bars as needed to avoid stretching.

Preview Resized Video Without Saving

If you just want to preview how the resized video would look before saving it, use FFplay:

ffplay -vf scale=1280:720 input.mp4

FFplay is a handy media player included with FFmpeg, perfect for testing filters and outputs quickly.

Conclusion

Resizing videos with FFmpeg may be command-line based, but it doesn’t need to be complicated. By mastering just a few basic commands, beginners can easily adjust video dimensions, control image quality, preserve aspect ratios, and prepare content for any platform.

FFmpeg is not only efficient but also incredibly versatile. Experiment with different resolutions and parameters until you find the exact settings that meet your needs. Whether you’re resizing a single video or a library of clips, FFmpeg gets the job done quickly and reliably.

Frequently Asked Questions (FAQ)

Q: Is FFmpeg free to use?
Yes, FFmpeg is completely free and open-source.
Q: Does FFmpeg support all video formats?
FFmpeg supports a wide range of formats, including MP4, AVI, MKV, MOV, FLV, and many others.
Q: Will resizing a video reduce its quality?
Resizing can affect quality if the resolution or bitrate is significantly reduced. Proper values help retain acceptable quality levels.
Q: Can I upscale a video using FFmpeg?
Yes, you can scale a video up, but increasing resolution might not improve visual quality—it may look more pixelated or blurry.
Q: Is there a graphical interface for FFmpeg?
FFmpeg itself is a command-line tool, but there are GUI front-ends like HandBrake and Shotcut that use FFmpeg behind the scenes.
Q: How can I check the resolution of my video using FFmpeg?
Use the command ffmpeg -i your_video.mp4 and look for resolution info under the video stream section.
Q: Can I automate video resizing tasks?
Yes, FFmpeg works well with scripts, allowing batch processing of multiple video files efficiently.