FFmpeg API Cloud LogoFFmpeg API Cloud

resize video ffmpeg

Resize video with FFmpeg

If you need to resize video with FFmpeg, the usual goal is to fit content into a target frame without rebuilding the entire workflow from scratch. This page shows the practical FFmpeg resize command, the matching FFmpeg API request, and an online tool you can test in the browser.

FFmpeg CLI

How to resize a video in FFmpeg

A common FFmpeg resize workflow scales the source into a target width and height, preserves aspect ratio, then pads the remaining space when needed.

FFmpeg resize command

Click any part of the command to see what it does.

FFmpeg resize command

ffmpeg

This runs the FFmpeg binary. The rest of the command defines the source file, resize filter, codecs, and output path.

API

Use the same video resize workflow through the FFmpeg API

If you need FFmpeg resize capability inside your product, app, or backend workflow, the FFmpeg API gives you a faster path than maintaining your own media processing infrastructure. You can send one args-based resize request and reuse the same workflow in production.

Request

curl -X POST https://ffmpeg-api.cloud/v1/jobs \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ffmpegArgs": [
    "-y",
    "-i",
    "{{input}}",
    "-vf",
    "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2",
    "-c:v",
    "libx264",
    "-c:a",
    "aac",
    "{{output}}"
  ],
  "inputs": {
    "input": {
      "type": "url",
      "url": "https://example.com/input.mp4"
    }
  },
  "outputs": {
    "output": {
      "fileName": "resized-1280x720.mp4"
    }
  }
}'

Response

{
  "jobId": "job_01hxyz...",
  "status": "queued",
  "runtimeSeconds": 0,
  "creditsCharged": 0,
  "createdAt": "2026-04-14T10:30:00.000Z"
}

Online tool

Try this FFmpeg API resize video tool online

Upload a source video, set the target frame, and run the resize job in the browser. It is the quickest way to validate output dimensions before wiring the same request into your own app or backend.

Live playground

Resize video with FFmpeg

Scale a source video to a target frame with an args-based FFmpeg API request.

Upload a file to generate a temporary source URL

Source URLs are valid for 1 hour. Max file size: 2GB.

Generated FFmpeg API request

This request is initialized from the current template, and you can edit it before running.

Use public URLs for inputs directly in this request. If you upload files above, copy the generated source URL into the request. In ffmpegArgs, each {} placeholder should match a key in inputs or outputs. For example, {} should match inputs.input, {} should match inputs.video, and {} should match outputs.output.

Use cases

Common ways to use FFmpeg video resize

Resizing is useful when you want consistent frame sizes for product surfaces, delivery targets, and downstream transforms.

Prepare videos for embeds and app layouts

Resize source videos into predictable frames for product cards, CMS embeds, support articles, or in-app preview modules.

Normalize user uploads before processing

Bring user-generated content into a consistent resolution before moderation, thumbnails, or additional encoding steps.

Create platform-specific exports

Generate alternate landscape or standard-size outputs for feeds, landing pages, or internal publishing workflows.

FAQ

FFmpeg resize video FAQ

Common questions about resizing video with FFmpeg, preserving aspect ratio, and moving the same workflow into the FFmpeg API.

Related templates

Other FFmpeg templates

Explore other FFmpeg templates for compression, thumbnails, trimming, and more.