Tutorial · Python · ~10 min

SDR to HDR: the FFmpeg Alternative That Scales

FFmpeg can lift SDR to pseudo-HDR with a few filters. Doing it well — per scene, artifact-free — is where ffmpeg stops and a purpose-built model starts.

PythonFFmpeg AlternativeAPI

Why this matters

FFmpeg's zscale + tonemap path applies a global curve: shadows crush or highlights clip depending on the scene. It is fast and free, and the results show it.

A trained inverse-tone-mapping model analyzes each scene's luminance histogram and rebuilds dynamic range per scene, which is why the output holds highlight and shadow detail.

How it works

If a one-line ffmpeg command covers your quality bar, keep it. The API is for when you need per-scene quality at volume without GPU farms.

Submit a job with an input URL (S3, GCS or HTTPS), poll the job URL, and download the rendered output. No GPU, no queues, no ffmpeg builds to babysit.

Code

Python
import requests, time

API = "https://api.mlslabs.io/v1/sdr2hdr/jobs"
headers = {"X-API-Key": "YOUR_API_KEY"}
payload = {"input": "s3://bucket/video.mp4", "preset": "cinema"}

resp = requests.post(API, json=payload, headers=headers)
job = resp.json()
while job["status"] not in ("succeeded", "failed"):
    time.sleep(3)
    job = requests.get(job["url"], headers=headers).json()

print("Output:", job["output_url"])

Pro tips

  • Test both on the same 3 clips before deciding — look at specular highlights and skin tones.
  • ffmpeg is great for burn-in previews; use the API for the actual deliverable.
  • License-wise, HDR conversion has no codec patent baggage — the API handles encoding separately.

Pricing note

Usage is metered per minute of media processed; the first tier is free each month. Volume discounts kick in automatically.

FAQ

Common questions

Is the API just ffmpeg behind a URL?

No. Rendering runs our trained models plus the encode stage; you can inspect the settings JSON every job returns.

Can I still use ffmpeg for post-processing?

Absolutely — the API outputs standard MP4/MOV that any tooling accepts.

What if my ffmpeg results are good enough?

Then you do not need us for that pipeline. We would rather earn the migration with a quality comparison than with marketing.