video filter

The FFmpeg scale filter

Resizes video to a target width and height, with optional aspect-preserving arithmetic.

3 of 3 variants measured Measured 2026-08-20

The part that catches people

Use -2, not -1, for the dimension you want computed. H.264 requires even dimensions, and -1 will happily produce an odd number that makes libx264 fail with 'width not divisible by 2'. -2 rounds to the nearest even value.

Measured, not described

Every row below is a real job. The same 1280x720 five-second H.264 source went through each variant, so the numbers are comparable to each other and to every other filter page on this site. Encode time is the FFmpeg step on its own, separated from the download and the upload.

VariantEncodeOutputCost
720p, height computed3935 ms514.0 KB · 1280x720$0.0059
480p, height computed772 ms346.3 KB · 854x480$0.0023
Fit inside a box4126 ms514.0 KB · 1280x720$0.0057

The exact commands

720p, height computed

job_086816ae11534c48

The safe form. -2 keeps the aspect ratio and guarantees an even height.

ffmpeg -i https://cdn.rendobar.com/assets/examples/sample.mp4 -vf "scale=1280:-2" -t 5 out.mp4

480p, height computed

job_27a8c1f5f1624db2

Same arithmetic at a smaller target, to show how output size scales.

ffmpeg -i https://cdn.rendobar.com/assets/examples/sample.mp4 -vf "scale=854:-2" -t 5 out.mp4

Fit inside a box

job_1aec6875a7224925

Letterbox-free fit. Never upscales past the box on either axis.

ffmpeg -i https://cdn.rendobar.com/assets/examples/sample.mp4 -vf "scale=w=1280:h=720:force_original_aspect_ratio=decrease" -t 5 out.mp4

How these numbers were produced

Each variant was submitted to the Rendobar API as an ffmpeg job against the same public source file, and the response was recorded verbatim. Encode time is the API's own per-step timing for the FFmpeg step. Output size is the byte count of the file the job produced. Cost is what the job was actually billed.

Nothing here was estimated, and the whole set is re-runnable, so if a figure looks wrong it can be checked rather than argued about. The 72 variants behind this filter reference cost $0.193082 in total to measure.

Frequently asked questions

What does the FFmpeg scale filter do?

Resizes video to a target width and height, with optional aspect-preserving arithmetic.

What is the most common mistake with scale?

Use -2, not -1, for the dimension you want computed. H.264 requires even dimensions, and -1 will happily produce an odd number that makes libx264 fail with 'width not divisible by 2'. -2 rounds to the nearest even value.

How long does scale take to run?

On a 1280x720 five-second H.264 source, the fastest variant on this page (480p, height computed) spent 772 ms inside FFmpeg. That figure is the encode step alone, measured separately from the download and the upload, so it is the filter's own cost rather than the round trip.

Do I need FFmpeg installed to use scale?

Not with Rendobar. Every command on this page ran through the Rendobar API against a URL, with no local FFmpeg install and no server. The job id next to each row is the real job that produced the numbers.

Run scale without installing FFmpeg

Every command on this page ran through the API against a URL. No binary, no server.