Tutorial · Python · ~10 min

Remove Text from Video with an API

Subtitles are the common case, but the same inpainting engine removes logos, lower thirds, and stray graphics — by region or by detection.

PythonText RemovalAPI

Why this matters

Rendered text is part of the pixels — you cannot turn it off like soft subs. Removing it cleanly means reconstructing the video underneath, frame by frame.

Inpainting models fill erased regions with plausible texture: backgrounds, motion, and lighting continue under the text.

How it works

Pass explicit regions (normalized x/y/w/h) or set regions=auto. The API detects text-like features and inpaints them across the timeline.

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/subtitle-eraser/jobs"
headers = {"X-API-Key": "YOUR_API_KEY"}
payload = {"input": "s3://bucket/clip.mp4", "regions": [[0, 0.62, 1.0, 0.82]]}

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

  • For logos that persist all scene, an explicit keep/erase region is more predictable than detection.
  • Motion-heavy scenes: use the high-quality preset to avoid smearing.
  • Erase on the cleanest available master, then re-encode once.

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

Can it remove animated lower thirds?

Yes — per-frame inpainting follows the moving graphic; results depend on background complexity.

Does it handle partial occlusion (text over faces)?

It reconstructs what it can; for faces over complex motion we recommend the high-quality preset and a QC pass.

What about watermarks that move?

Explicit animated regions are supported in the job payload.