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
- 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 Request Moderated vs Content Moderated, and Sume's reason
BFL separates input moderation from output moderation and adds a Moderation Reasons array. Sume groups refusals under content_policy_rejected.
- FLUX safety_tolerance 0 to 5, and what Sume does instead
BFL's safety_tolerance runs 0 (strictest) to 5 on FLUX.2, default 2. Sume has no such dial: it returns 400 unsupported_parameter.
Written by Sume