How to rotate a video 90 degrees and save it

Rotate a video 90 degrees with ffmpeg's transpose filter: clock turns it clockwise, cclock counterclockwise. Sume's video filter saves a new MP4.

4 min readSume
All posts

To rotate a video 90 degrees and save it, re-encode the clip with ffmpeg's transpose filter: transpose=clock turns the picture 90° clockwise and transpose=cclock turns it 90° counterclockwise, so the frame's width and height swap. With Sume, for a clip already hosted on Sume, send that filter as the filtergraph of POST /v1/video-filter, and you get back a new MP4 in the new orientation.

The FFmpeg facts come from its ffmpeg tool and filters documentation and the Sume facts from the Video filter docs and the Sume API reference, all read on 2026-09-27. Which filter names Sume accepts is read from its filter compiler and describes current behavior.

Which transpose value rotates the video which way?

On your own computer, FFmpeg applies the filter with -vf while it re-encodes the file: ffmpeg -i input.mp4 -vf transpose=clock output.mp4 saves a copy turned 90° clockwise.

transpose takes a direction. FFmpeg's docs mark the numeric values as deprecated in favor of the names, but both still turn up in scripts, so the table lists both. Plain transpose with no value is not a plain rotation: its default, cclock_flip, also flips the picture vertically.

  • To rotate only the clips that are landscape, add passthrough: transpose=dir=clock:passthrough=portrait leaves a clip alone when its height is at least its width.
Directions from the FFmpeg filters documentation, read 2026-09-27.
FiltergraphOld numeric formResult
transpose=clocktranspose=190° clockwise
transpose=cclocktranspose=290° counterclockwise
transpose=cclock_fliptranspose=0 (the default)90° counterclockwise and flipped vertically
transpose=clock_fliptranspose=390° clockwise and flipped vertically

How do I rotate a video 90 degrees with the Sume API?

Send the clip and the filter to POST /v1/video-filter. The video_url must already be your workspace's media.sume.com artifact or asset, such as the output of an earlier Sume job: the filter does not fetch from the open internet, and Sume has no public upload route for a file on your computer (which URLs each endpoint accepts). The encode needs an Idempotency-Key.

  • Check it for free first: POST /v1/video-filter/check takes the same body, runs the same schema, allowlist, and source checks, and returns diagnostics instead of a 400. It creates no job and reserves no credits.
  • The default mode is async, so poll GET /v1/jobs/:id/status and then GET /v1/jobs/:id/result. The kind: video_filter result carries a new video_url, never the source, which stays untouched. mode: "sync" waits up to 30 seconds for a finished job.
  • The docs say the output inherits the source's geometry, frame rate, and audio unless the program changes them. A rotation changes the geometry, so a 1920×1080 clip comes back 1080×1920 and keeps its frame rate and audio.
curl -X POST https://api.sume.com/v1/video-filter \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: rotate-clip-001" \
  -d '{
    "video_url": "https://media.sume.com/artifacts/artf_demo/sideways.mp4",
    "filtergraph": "transpose=clock"
  }'

How do I rotate a video 180 degrees or by a few degrees?

For a half turn, chain two quarter turns, transpose=clock,transpose=clock, or flip the picture both ways with hflip,vflip. transpose, hflip, and vflip are all on Sume's allowlist today.

For a small tilt, use rotate, also on the allowlist, which takes an angle in radians and turns clockwise; a negative angle turns counterclockwise. FFmpeg's docs rotate by 45 degrees with rotate=45*PI/180, so a 5-degree fix is rotate=5*PI/180. The output keeps the input's width and height by default, so the corners of the turned picture are cut off and the uncovered area is filled with fillcolor, black by default.

Will rotating turn a landscape video into a portrait video?

It changes the frame's shape, not the framing: a rotated landscape clip becomes a portrait frame with the scene lying on its side. To put a landscape shot upright into a 9:16 frame, crop it or fit it into the frame instead, as in convert a landscape video to vertical.

What does it cost, and what are the limits?

One job rotates one clip, so a batch of clips is one job per clip, each with its own Idempotency-Key. The check is free, and each encode is billed per job at the rate GET /v1/catalog lists, plus a 5.5% agent fee by default. The graph rules and encoder settings are in Sume's ffmpeg filter allowlist.

From Video filter and the Sume API reference, read 2026-09-27.
LimitWhat the docs say
Source lengthUp to 300 seconds; a longer source fails with output_duration_exceeded.
Source URLYour workspace's media.sume.com artifact or asset; off-host URLs are rejected at admit.
HDR sourcesPQ and HLG sources are refused with hdr_source_unsupported.

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume