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.

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.
| Filter | What it changes | On the allowlist |
|---|---|---|
| swapuv | Exchanges the U and V colour channels; luma unchanged | Yes |
| negate | Inverts the picture | Yes |
| hue | Rotates hue by a set amount | Yes |
| monochrome | Removes colour | Yes |
| lut3d | Applies a LUT file | No (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
- Turn a video into a line drawing: edgedetect in video-filter
Send edgedetect=low=0.08:high=0.3 to Sume's video-filter for an outline look on any hosted clip. Add negate for dark lines on white. One $0.02 job.
- video-inspect fast seek: sample_times vs requested_times on a Short
Why the still from a fast video-inspect can be earlier than the time you asked for, which field tells you the real instant, and when to use precise instead.
- Which ffmpeg filters does Sume's video filter allow? All 66
Sume's video filter accepts a fixed allowlist of 66 pixel filters in five groups: tone, blur, geometry, time, compositing. The list, the caps, and a free check.
- How to assemble a long-form video with the Timeline 1.0 API
Timeline 1.0 renders one audio spine plus 1 to 200 ordered video slots into one MP4. Every URL must be Sume-hosted; the plan preflight is unbilled.
Written by Sume