FFmpeg API Cloud LogoFFmpeg API Cloud

rotate video ffmpeg

Rotate video with FFmpeg

If you need to rotate video with FFmpeg, the common goal is to fix orientation or create alternate portrait and landscape exports. This page shows the practical FFmpeg command, the matching FFmpeg API request, and an online tool you can test in the browser.

FFmpeg CLI

How to rotate a video in FFmpeg

A common FFmpeg rotation workflow uses the `transpose` filter, then writes the rotated result into a new MP4 output.

FFmpeg rotate command

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

FFmpeg rotate command

ffmpeg

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

API

Use the same video rotation workflow through the FFmpeg API

If you need orientation fixes 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 request and reuse the same rotation 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",
    "transpose=1",
    "-c:v",
    "libx264",
    "-c:a",
    "copy",
    "{{output}}"
  ],
  "inputs": {
    "input": {
      "type": "url",
      "url": "https://example.com/input.mp4"
    }
  },
  "outputs": {
    "output": {
      "fileName": "rotated-90.mp4"
    }
  }
}'

Response

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

Online tool

Try this FFmpeg API rotate video tool online

Upload a source video, choose the target rotation, and run the job in the browser. It is the quickest way to validate orientation changes before wiring the same request into your own app or backend.

Live playground

Rotate video with FFmpeg

Rotate a source video 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 rotation

Rotation is useful when you need to correct orientation problems or generate alternate layout variants from the same source asset.

Fix sideways or upside-down uploads

Correct user-generated content that arrives in the wrong orientation before previews, moderation, or publishing.

Prepare alternate portrait or landscape exports

Generate rotated outputs for app surfaces, social placements, or internal review workflows that need a different orientation.

Normalize assets before later transforms

Rotate source videos into the right orientation before compression, watermarking, thumbnails, or downstream processing.

FAQ

FFmpeg rotate video FAQ

Common questions about rotating video with FFmpeg, using transpose, and moving the same workflow into the FFmpeg API.

Related templates

Other FFmpeg templates

Explore other FFmpeg templates for resize, watermarking, compression, and more.