The Deflicker API
Remove flicker from video in your own software. Send a video, and we measure it, pick the fix that suits it and give you back the fixed copy.
What it does
The API runs the same jobs on the same servers as fixing a video on this site. Each video is measured with FlickerScope, and then:
- Flicker from LED and fluorescent lights, slow motion included, goes through Deflicker Fusion on our GPUs, with the strength chosen for the clip.
- Time-lapse flicker, where the exposure jumps from one shot to the next, is evened out, and the clip's real changes in light stay.
- A video with barely any flicker is left as it was and costs nothing.
You get back an MP4 at the same resolution and frame rate, with the original sound. The same key will also work in our panel for Premiere Pro and After Effects, which isn't out yet.
Credits
One credit is one Fusion clip: up to 1,000 frames of 1080p. Bigger videos use more, up to 6 for one video, and any video uses at least 1. Credits are reserved when a job starts and given back if it fails.
$3.99 a credit, plus a processing fee that covers the cost of the payment, plus tax where it applies. Stripe shows the exact total before you pay.
Add to a key you already have
You pay on Stripe's secure checkout page, then come back here for your key. Stripe handles the payment and any sales tax as the merchant of record. We never see your card details.
Your footage
We never review your footage. Videos and results are deleted automatically within 24 hours of the upload, so download results promptly. Our privacy policy says where a video goes while it's being fixed.
Quick start
The whole job in Python. Keep your key on your server, never in a web page or an app you ship.
import os, time, requests
API = "https://api.deflickerapp.com/pro"
KEY = {"Authorization": "Bearer " + os.environ["DEFLICKER_KEY"]}
path = "clip.mp4"
# Start the upload. frames, width and height are optional: they give an early estimate of the credits.
up = requests.post(f"{API}/uploads", headers=KEY, json={"name": path, "size": os.path.getsize(path)})
up.raise_for_status()
up = up.json()
# Send the parts. Sending one again replaces it.
with open(path, "rb") as f:
for n in range(1, up["parts"] + 1):
r = requests.put(f"{API}/uploads/{up['uploadId']}/parts/{n}", headers=KEY, data=f.read(up["chunkBytes"]))
r.raise_for_status()
# Start the job. This reserves the credits.
r = requests.post(f"{API}/uploads/{up['uploadId']}/complete", headers=KEY)
r.raise_for_status()
job = r.json()["jobId"]
# Wait for it.
while True:
status = requests.get(f"{API}/jobs/{job}", headers=KEY).json()
if status["state"] in ("done", "failed"):
break
time.sleep(5)
# Download the fixed video.
if status["state"] == "done":
with requests.get(f"{API}/jobs/{job}/result", headers=KEY, stream=True) as r, open("fixed.mp4", "wb") as out:
for chunk in r.iter_content(1 << 20):
out.write(chunk)
else:
print(status["error"])
Routes
The base address is https://api.deflickerapp.com/pro. Every request sends Authorization: Bearer dfk_....
| Route | Send | Answer |
|---|---|---|
GET /account | Nothing | {credits} |
POST /uploads | {name, size, frames, width, height} | {uploadId, chunkBytes, parts, clips} |
PUT /uploads/{id}/parts/{n} | Raw bytes, n from 1, chunkBytes each except the last | {ok} |
POST /uploads/{id}/complete | Nothing | {jobId, clips, credits}. Asking again returns the same job and charges nothing more. |
GET /jobs/{id} | Nothing | {state, stage, progress, error?, note?, flicker?, resultUrl?}. state is queued, running, done or failed, and flicker is {before, after}, with after null if the video was left as it was. |
GET /jobs/{id}/result | Nothing | The fixed video |
Errors
Errors are JSON, {"code": "...", "reason": "..."}, and reason is written to show a person. When it's worth trying again later, the answer has a Retry-After header.
| Status | Code | Meaning |
|---|---|---|
| 401 | bad_key | The key is wrong or was replaced. |
| 402 | no_credits | Not enough credits. A finished upload waits, so you can add credits and ask again. |
| 404 | not_found | It doesn't exist, it belongs to another key, or it has been deleted. |
| 409 | missing_parts | Some parts didn't arrive. parts lists them, so send those again and complete again. |
| 410 | gone | The result has been deleted. |
| 413 | too_large, too_long | The video is over a limit below. |
| 429 | busy | This key already has 3 jobs running. A finished upload waits, so ask again when one ends. |
| 429 | rate_limited | Too many requests. Wait a moment. |
| 503 | busy | Our GPUs are busy. Try again later. |
Limits
- One video: up to 750 MB, 3,600 frames, 4K and 6 credits.
- One key: 3 jobs at once and 60 new uploads an hour.
- One connection: 6 new uploads and 600 requests a minute.
Questions, or a volume that doesn't fit these limits? Email contact@silent.co.