Swap the colours of a video by API: the swapuv chroma-swap look

swapuv exchanges a clip's U and V chroma channels and leaves brightness alone, a quick surreal colour look. How to run it in Sume's video filter.

4 min readSume
All posts

To swap the colours of a video through an API, run the swapuv filter. FFmpeg describes it as swapping the U and V colour components of each frame while the luma, the brightness, stays unchanged. In Sume's video filter you send "filtergraph": "swapuv" with a clip hosted on media.sume.com and get back a new MP4 for $0.02. It is on the allowlist, so a free check passes before you pay.

What does swapuv do to the picture?

A video stores brightness (Y) separately from two colour-difference channels (U and V). Exchanging U and V means every hue is read from the wrong channel, so colours rotate into a different range while the light and dark structure of the shot stays intact. You get a recognisable image in colours that do not belong to it.

I would not promise a specific outcome per hue. Treat it as a stylised look and judge it on a real frame before you apply it to a batch. Because the filter only touches chroma, it differs from negate, which inverts the picture, and from hue, which rotates colour by an amount you choose.

How do I run it on a Sume clip?

Send the graph to the check endpoint first. It creates no job and costs nothing, and it returns diagnostics if the graph is malformed. When it passes, send the same body to POST /v1/video-filter with an Idempotency-Key header. The server adds the input and output labels itself, so the graph is only the filter name.

The source must be a clip in your workspace on media.sume.com and no longer than 300 seconds. HDR and non-YUV sources fail closed.

curl -s 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_EXAMPLE.mp4",
    "filtergraph": "swapuv"
  }'

How do I preview before committing a batch?

Encode one short clip, then pull a frame from the result with the frame extractor rather than watching the whole video. It accepts explicit times in seconds (1 to 24 of them) and returns durable image files.

For a milder version, put another filter after it in the same graph, for example swapuv,eq=saturation=0.7. The graph limit is 32 filters and 2,048 characters, so there is room to experiment.

swapuv beside related colour filters on Sume's allowlist, read 2026-10-12
FilterWhat it changesOn the allowlist
swapuvExchanges the U and V colour channels; luma unchangedYes
negateInverts the pictureYes
hueRotates hue by a set amountYes
monochromeRemoves colourYes
lut3dApplies a LUT fileNo (reads a file)

What can go wrong?

An unknown filter name returns invalid_filtergraph with the allowlist in the message. A source with no audio still renders; you only get a soft warning that the output is silent. The encode can still fail on the box with a structured job error, in which case you simplify the graph, run the check again and resubmit.

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume