How to flip a video horizontally with an API

To mirror a video left to right, run the hflip filter. Sume's video filter takes it as a one-line filtergraph and returns a new MP4.

4 min readSume
All posts

To flip a video horizontally, mirror every frame left to right with the hflip filter. With Sume you send a one-line filtergraph, hflip, to the video filter endpoint and get back a new MP4; the original file is not touched.

The Sume facts come from the Video filter docs and, for the allowlist, the filter code, read 2026-09-29. What hflip does is from FFmpeg's own filter documentation, snapshotted the same day.

How do I flip a video with the Sume API?

The clip must already be a media.sume.com file in your workspace, such as the output of an earlier Sume job. The program is a filtergraph string: a filters-only ffmpeg graph. You do not write inputs, outputs or paths; the server wraps the graph for you.

Run the free check first, then send the same body to /v1/video-filter with an Idempotency-Key. The default mode is async, so you poll the job and read its result.

curl -X POST https://api.sume.com/v1/video-filter/check \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"video_url":"https://media.sume.com/artifacts/artf_demo/talk.mp4","filtergraph":"hflip"}'

curl -X POST https://api.sume.com/v1/video-filter \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: flip-001" \
  -d '{"video_url":"https://media.sume.com/artifacts/artf_demo/talk.mp4","filtergraph":"hflip"}'

How do I get the flipped file back?

There is no GET /v1/video-filter/:id. Poll GET /v1/jobs/:id/status until the job is terminal, then read GET /v1/jobs/:id/result. A finished result is kind: video_filter with a new video_url, never the source URL, plus duration_seconds and the compiled filters.

The output keeps the source's size, frame rate and audio unless the program changes them, so a plain flip leaves the sound alone.

Can I flip vertically, or flip and rotate?

Yes for the flip: the allowlist has vflip next to hflip, and FFmpeg describes them as flipping the input video vertically and horizontally. Filters chain with commas, for example hflip,vflip, which is a 180-degree turn. Rotation has its own steps in How to rotate a video 90 degrees.

One caution: a mirrored frame mirrors everything in it. Text, logos and signs in the picture read backward afterward. If the mirrored copy is only for a look, that is fine; if the frame has words, check the result.

Can I flip only part of a video?

The filter runs on the whole clip; there is no time range on it. To flip one part, cut that part out first with video trim, which returns a new MP4 holding only the range you name, then send that MP4 through the filter. Trim's start and end are covered in video_trim_range_conflict: send end or duration, not both.

Joining the flipped part back between the untouched parts is a Timeline render, which places clips in order over one audio track. In current code a Timeline render takes sound only from its audio track and optional soundtrack, so each clip's own audio is dropped.

What are the limits?

The check catches unknown filter names and bad structure before you pay for an encode; see Validate a video filter program for free. It does not test option values, so a program that passes can still fail on the worker.

From Video filter, read 2026-09-29.
LimitValue
Source lengthUp to 300 seconds
filtergraph length2048 characters
Named filters per graph32
Source locationThis workspace's media.sume.com files
Unavailable filtersdrawtext, subtitles, movie, lut3d
PriceListed on API pricing

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume