Fix lens distortion in video by API with lenscorrection
Sume's video filter allowlists ffmpeg's lenscorrection, so barrel distortion from a wide action-cam clip can be corrected by coefficients you choose and test.

Yes, with coefficients you supply. lenscorrection is on the allowlist for POST /v1/video-filter, so a graph like lenscorrection=k1=-0.227:k2=-0.022 can straighten barrel distortion and return a new MP4. Sume has no lens profiles: nothing looks up a GoPro model for you.
Blackmagic's September 8 release notes say DaVinci Resolve 21.1 adds a line-based calibration type to its lens distortion tool, which is a way to derive a correction visually. The Sume route is the manual one, documented in Video filter, read 2026-10-01.
How do I run the correction?
Import the clip with POST /v1/media-imports, then send a filtergraph. The coefficients above are a starting point from ffmpeg's filter documentation, not a Sume preset; sign and strength depend on the lens, so check a short sample first.
curl -X POST https://api.sume.com/v1/video-filter \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: lens-fix-001" \
-d '{
"video_url": "https://media.sume.com/artifacts/artf_demo/wide.mp4",
"filtergraph": "lenscorrection=k1=-0.227:k2=-0.022"
}'How do I test before paying for the full clip?
Call POST /v1/video-filter/check with the same body: it is free, runs the allowlist and source preflight, and returns valid and diagnostics. Then cut a few seconds with video trim and filter that. Corrected edges often need a crop; a crop op runs before the filtergraph, so put the crop after in a second pass.
What are the limits?
| Item | Value |
|---|---|
| Price | $0.02 per encode job; check is free |
| Source | Up to 300 seconds, on media.sume.com |
| Graph | Up to 2048 chars and 32 named filters |
| Output | Keeps source geometry, frame rate and audio unless the program changes them |
| Distortion profiles | None; coefficients are yours |
Sources
Related posts
More in Developers
- Fix a yellow or blue color cast in a video by API (colortemperature)
Sume's video filter allowlists colortemperature, a Kelvin value from 1000 to 40000 with a default of 6500. Warm or cool a clip and mix it in part.
- FLUX.2 JSON prompt: on Sume it is text in the prompt field
BFL says FLUX.2 accepts JSON-structured prompts. On Sume, prompt is a plain string, so JSON goes in as text; other fields are typed.
- FLUX.2 LoRA API: finetune_id on BFL, not on Sume
BFL serves klein LoRAs through -finetuned endpoints with finetune_id. Sume rejects provider-specific parameters, so use reference images instead.
- FLUX.2 pose and layout guidance without ControlNet
FLUX.2 has no ControlNet input: BFL says to pass a pose or layout as a reference image. On Sume use image_urls or input_references; unlisted fields get a 400.
Written by Sume