Tutorial · Python · ~10 min
Remove Subtitles from Video Before Dubbing
Dubbing over hardcoded subtitles looks broken — the old text stays under the new voice. Erasing first makes every language track clean.
Why this matters
Voice actors can't dub over legible foreign text without visual confusion, and the hardsubs would still show in the final export.
The standard order is: erase burned-in text → dub → add localized soft subtitles. Erasing is the one step that touches pixels, so it happens once on the master.
How it works
Submit the episode with region detection on. The API returns a subtitle-free master plus a mask preview you can eyeball before dubbing starts.
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
import requests, time
API = "https://api.mlslabs.io/v1/subtitle-eraser/jobs"
headers = {"X-API-Key": "YOUR_API_KEY"}
payload = {"input": "s3://bucket/episode.mp4", "regions": "auto"}
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
- Erase on the highest-quality master you have; dubs inherit it.
- Keep the mask preview in your QC ticket so editors can verify.
- Coordinate erase → dub → sub as three API calls in one pipeline.
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 I erase only the bottom subtitle band?
Yes — pass explicit regions to erase only that band and preserve any other overlay.
Does erasing degrade the video?
Inpainting reconstructs the covered pixels; on clean footage the result is visually lossless, on busy footage the high-quality preset helps.
Do you also time the dubs?
No — erasing is our job. Timing and sync belong to your dubbing platform.
Keep exploring
Related guides
Subtitle Eraser API
Remove hardcoded subtitles cleanly for localization and short-drama export.
Learn moreVocal Separator API
Isolate vocals or instrumentals from speech and music mixes.
Learn moreSubtitle Extractor API
Extract on-screen text and spoken dialogue with frame-accurate timestamps.
Learn more