10/16/2025

Resize videos with FFmpeg using the scale filter. Learn fixed resolution, aspect-ratio-safe scaling, half-size scaling, and compression-friendly settings.

How to Change Video Resolution with FFmpeg

Use FFmpeg's scale filter to resize a video to 1080p, 720p, a fixed width, a fixed height, or a proportional size. Scaling is useful for web delivery, smaller uploads, thumbnails, previews, and matching a required resolution.

For a form-based command builder, use the Resize Video tool.

Resize to 1280x720

ffmpeg -i input.mp4 -vf "scale=1280:720" -c:v libx264 -crf 23 -preset medium -c:a copy output.mp4

This forces the video to exactly 1280x720. Use it only when the source has the same aspect ratio, or the image may look stretched.

Preserve Aspect Ratio by Width

To set the width and let FFmpeg calculate the height:

ffmpeg -i input.mp4 -vf "scale=1280:-2" -c:v libx264 -crf 23 -preset medium -c:a copy output.mp4

-2 preserves aspect ratio and makes the computed dimension even, which avoids common encoder errors.

Preserve Aspect Ratio by Height

To make a 720p version:

ffmpeg -i input.mp4 -vf "scale=-2:720" -c:v libx264 -crf 23 -preset medium -c:a copy output.mp4

This is often safer than forcing 1280:720, especially if the source is vertical or has an unusual aspect ratio.

What the Options Mean

Option Meaning
-vf "scale=1280:720" Applies the scale video filter.
-2 Auto-calculates the other dimension and keeps it divisible by 2.
-c:v libx264 Re-encodes video as H.264.
-crf 23 Sets a practical quality target.
-c:a copy Copies the original audio stream.

Scale to Half Size

You can use expressions based on the input dimensions:

ffmpeg -i input.mp4 -vf "scale=iw/2:ih/2" -c:v libx264 -crf 23 -preset medium -c:a copy output.mp4

iw means input width and ih means input height.

Resize and Compress Together

Scaling down and compression are often done together:

ffmpeg -i input.mp4 -vf "scale=-2:720" -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k output.mp4

If the goal is a smaller file, use the Compress Video tool because it lets you tune CRF, preset, codec, and resolution together.

Common Problems

The video looks stretched.
Use scale=1280:-2 or scale=-2:720 instead of forcing both width and height.

FFmpeg says width or height is not divisible by 2.
Use -2 instead of -1 for the automatic dimension when encoding H.264 or H.265.

The file is still too large.
Increase CRF, use a smaller resolution, or use a slower preset.

The output quality is too low.
Lower CRF from 23 to 20 or 18.

Related FFmpeg Pages

Related tool

Resize Video with FFmpeg

Generate FFmpeg scale commands to change video resolution while preserving aspect ratio when needed.

Open the command generator