Audio Redub API

POST /redub

About this tool

`/redub` targets localization, emergency fixes, and compliance edits where narration must swap or blend with programmatic clarity. Submit JSON containing `video_url`, `voice_url`, a `mode` switch (`replace` versus `mix`), and `bg_source` strategies such as `keep`, `external`, `centerremove`, or `separate`. Workers align timelines, duck music when instructed, and return async downloadables just like every other FFmpeg operation, always keyed to your subscription’s API credential and never reliant on multipart file spam.

Because audio phase issues cause worse UX than blurry video, the API emits FFmpeg diagnostics when loudness envelopes diverge wildly. Respect sample-rate drift by sourcing voice tracks rendered at identical project tempo; uploading scratch VO from conferencing tools without trimming breaths invites clicks after mux. Enterprises often pair `/redub` with `/silence_process` for automated gatekeeping before QA humans listen once.

Each `bg_source` path maps to a distinct FFmpeg filter topology documented in `/api-docs#...`. Selecting `mix` preserves beds under dialogue when levels cooperate, while `replace` stomps incompatible legacy tracks. Understand these semantics legally as well; mixing copyrighted instrumentals pulled from unknown `voice_url` sources remains your licensing problem, not ours.

Observability treats each job distinctly: log payloads without secrets but keep correlation IDs beside task hashes. Burst traffic from binge dubbing spikes should respect exponential backoff guidelines published for your tier. Consumers hunting “free overdub widgets” won’t find that here; you’re orchestrating FFmpeg as paid infrastructure tied to SLA-minded teams.

Finalize by verifying lip sync tolerances visually; FFmpeg can only stretch audio within the physics encoded in parameters. Iterate via JSON tweaks rather than re-uploading gigantic video blobs, another benefit of immutable remote URLs baked into every Droid Apps tool. Studios juggling multiple regional variants template `mode`, `voice_url`, and `bg_source` per territory while keeping identical `video_url` pointers, letting translation vendors swap stems without rebuilding video edits. Operational analytics show how often `centerremove` succeeds versus falls back; use those KPIs before promising automated music retention in contracts.

Try it now

How it works

  1. Stage both media URLs

    Place the master video and isolated voice narration at HTTPS endpoints. Confirm neither requires signed cookies and that codecs are decodable by our worker image.

  2. Declare mode and background policy

    Encode `mode` plus `bg_source` in JSON so FFmpeg builds the correct filter graph before muxing output tracks.

  3. POST `/redub` with API key

    Await the standard task envelope. No multipart upload path exists; only JSON bodies with remote references.

  4. Poll and retrieve new mux

    Watch `status_url` until success, then download the redubbed render for captioning, packaging, or further `/cut` operations.

Frequently asked questions

What does center channel removal do?

It tries to pull vocals or centered content from a stereo bed so you can replace narration. Results depend on how the original was mixed; test with your music before promising clients a clean instrumental.

Should I replace the track or mix with the original?

Use replace when the new voice should fully take over. Use mix when you want dialogue over an existing bed at controlled levels.

Why did my job fail immediately?

Usually the voice URL is unreachable, the JSON mode value is wrong, or the video link expired. Read the error body; it points to validation vs download failures.

Can I keep background music while swapping dialogue?

Yes. Set background source to keep or external and mode to mix or replace depending on whether the bed should stay under the new voice.

Do voice and video URLs need the same duration?

They should align for clean muxing. Trim or pad the voice track in your editor if lengths differ before submitting.

How do I use the Audio Redub API?

POST to /redub with a JSON body containing video_url, voice_url, mode and your X-API-Key header. The API returns a task_id; poll GET /task/{task_id} until status is "completed" to retrieve the download_url.

Via the REST API

curl -X POST https://droidapps.one/redub \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
  -d '{
         "video_url": "https://cdn.example.com/master.mp4",
         "voice_url": "https://cdn.example.com/voice.wav",
         "mode": "YOUR_MODE",
         "bg_source": "YOUR_BG_SOURCE"
       }'

Via the MCP server (droidapps-ffmpeg)

const job = await mcp.callTool("submit_job", {
  path: "/redub",
  body: {
    video_url: "https://cdn.example.com/master.mp4",
    voice_url: "https://cdn.example.com/voice.wav",
    mode: "YOUR_MODE",
    bg_source: "YOUR_BG_SOURCE"
  }
})
// Returns: { task_id: "abc123", status: "queued" }

const result = await mcp.callTool("wait_for_task", {
  task_id: job.task_id
})
// Returns: { status: "completed", download_url: "https://..." }