Skip to main content
Dub videos into new languages or translate transcripts for subtitles. Support for 20+ languages with automated voice matching.

Quick Example

import videodb

conn = videodb.connect()
coll = conn.get_collection()
video = coll.get_video("m-xxx")

# Dub video to Spanish
dubbed = coll.dub_video(
    video_id=video.id,
    language_code="es"
)
dubbed.play()

# Translate transcript to French
video.index_spoken_words()
french_transcript = video.translate_transcript(language="fr")

Video Dubbing

Replace the audio track with AI-generated voices in another language.
dubbed = coll.dub_video(
    video_id=video.id,
    language_code="hi",  # Hindi
    callback_url="https://your-backend.com/webhooks/dubbing"
)

# Returns a new video object
dubbed.play()

Parameters

ParameterTypeDefaultDescription
video_idstrrequiredSource video ID
language_codestrrequiredTarget language (ISO 639-1)
callback_urlstrNoneWebhook URL when complete

Supported Languages

LanguageCodeLanguageCode
SpanishesHindihi
FrenchfrJapaneseja
GermandeKoreanko
ItalianitChinesezh
PortugueseptArabicar
DutchnlRussianru
PolishplTurkishtr

Transcript Translation

Translate the spoken content for subtitles or text-based use cases.

Step 1: Index Spoken Words

# Required before translation
video.index_spoken_words()

Step 2: Translate

# Translate to French
french_text = video.translate_transcript(
    language="fr",
    additional_notes="Use formal tone"
)

print(french_text)

Parameters

ParameterTypeDefaultDescription
languagestrrequiredTarget language (ISO 639-1)
additional_notesstr""Style guidance for translation
callback_urlstrNoneWebhook URL

Style Guidance Examples

# Formal business content
additional_notes = "Use formal business language appropriate for corporate presentations"

# Casual content
additional_notes = "Use casual, conversational tone"

# Technical content
additional_notes = "Preserve technical terms in English where no equivalent exists"

# Marketing content
additional_notes = "Adapt cultural references for the target audience"

Use Cases

Global Product Launch

# Upload marketing video
video = coll.upload(url="https://example.com/product-launch.mp4")

# Create versions for key markets
languages = ["es", "fr", "de", "ja", "zh"]

for lang in languages:
    dubbed = coll.dub_video(
        video_id=video.id,
        language_code=lang,
        callback_url=f"https://backend.com/webhooks/dubbing/{lang}"
    )

Educational Content

# Upload lecture video
lecture = coll.upload(url="https://example.com/lecture.mp4")
lecture.index_spoken_words()

# Generate subtitles in multiple languages
for lang in ["es", "fr", "pt", "zh"]:
    translated = lecture.translate_transcript(
        language=lang,
        additional_notes="Educational content, maintain academic tone"
    )
    # Use with CaptionAsset for subtitles

Customer Support

# Dub support video for regional markets
support_video = coll.get_video("m-support-tutorial")

# Create localized versions
regional_versions = {
    "LATAM": "es",
    "Brazil": "pt",
    "France": "fr",
    "Germany": "de"
}

for region, lang in regional_versions.items():
    coll.dub_video(
        video_id=support_video.id,
        language_code=lang,
        callback_url=f"https://backend.com/webhooks/{region}"
    )

Best Practices

Pre-Dubbing Checklist

CheckWhy
Clear audioReduces transcription errors
Single speakerBetter voice matching
Minimal background musicCleaner dubbing result
Proper pacingAllows for language expansion

Language Expansion

Different languages have different word counts for the same content:
Original (English)Expansion
German+15-20%
French+15-20%
Spanish+10-15%
Japanese-10-15%
Chinese-20-30%
Plan for this when timing is critical.

Quality Review

After dubbing:
  1. Check lip sync on close-ups
  2. Verify tone matches content
  3. Review technical term pronunciation
  4. Test with native speakers

Async Processing

Dubbing is a long-running operation. Use callbacks:
# Start dubbing (returns immediately when callback_url is provided)
dubbed = coll.dub_video(
    video_id=video.id,
    language_code="ja",
    callback_url="https://your-backend.com/webhooks/dubbing"
)

print(f"Processing video ID: {dubbed.id}")

# When callback_url is not provided, SDK returns video object once process is done
dubbed = coll.dub_video(
    video_id=video.id,
    language_code="ja"
)
# This will wait and return the completed video object

Webhook Response

When the dubbing process completes, your webhook receives:
{
  "success": true,
  "data": {
    "id": "m-dubbed-xxx",
    "collection_id": "c-xxx",
    "name": "dubbed_video",
    "extension": "mp4",
    "size": "12345678"
  }
}

What You Can Build


Next Steps