The dub command runs the full pipeline: download, transcribe, translate, synthesize, and assemble.
The simplest way — auto-clone the original speaker's voice:
mazinger dub "https://youtube.com/watch?v=VIDEO_ID" \
--target-language Spanish \
--base-dir ./outputOr provide your own voice files:
mazinger dub "https://youtube.com/watch?v=VIDEO_ID" \
--voice-sample speaker.m4a \
--voice-script speaker_transcript.txt \
--target-language Spanish \
--base-dir ./outputThis produces a dubbed WAV file at ./output/projects/<slug>/tts/dubbed.wav.
To get a video file instead of just audio:
mazinger dub "https://youtube.com/watch?v=VIDEO_ID" \
--voice-sample speaker.m4a \
--voice-script speaker_transcript.txt \
--target-language Spanish \
--output-type videoVoice themes let you dub without providing any voice files. Choose from 16 pre-defined themes and Mazinger generates a voice automatically:
# List all available themes
mazinger profile list
# Dub using a theme
mazinger dub "https://youtube.com/watch?v=VIDEO_ID" \
--voice-theme narrator-m \
--target-language Spanish \
--base-dir ./outputAvailable themes: narrator-m/f, young-m/f, deep-m/f, warm-m/f, news-m/f, storyteller-m/f, kid-m/f, teen-m/f.
The generated voice profile is saved in the project directory and reused on subsequent runs.
You can also pre-generate a profile from a theme for repeated use:
mazinger profile generate narrator-f Italian -o ./my-narrator
mazinger dub "https://youtube.com/watch?v=VIDEO_ID" \
--clone-profile ./my-narrator --target-language ItalianVoice profiles let you skip --voice-sample and --voice-script. They are hosted on HuggingFace and downloaded automatically.
mazinger dub "https://youtube.com/watch?v=VIDEO_ID" \
--clone-profile abubakr \
--target-language ArabicProfiles also work with local files:
mazinger dub ./lecture.mp4 --clone-profile abubakr
mazinger dub ./podcast.mp3 --clone-profile abubakrSee Voice Profiles for the full list and how to upload your own.
mazinger dub "https://youtube.com/watch?v=VIDEO_ID" \
--clone-profile abubakr \
--embed-subtitles \
--subtitle-font-size 24 \
--subtitle-font-color yellow--embed-subtitles implies --output-type video — no need to set both.
# Subtitles only (keeps original audio)
mazinger subtitle video.mp4 --srt translated.srt -o output.mp4
# Subtitles + replacement audio
mazinger subtitle video.mp4 --srt translated.srt --audio dubbed.wav -o output.mp4For detailed styling options, see Subtitle Styling.
If you only need a translated SRT file and no audio synthesis:
mazinger translate "https://youtube.com/watch?v=VIDEO_ID" \
--target-language French \
--base-dir ./outputThis downloads the video, transcribes it, extracts thumbnails and a description, then translates the subtitles. The result is saved at ./output/projects/<slug>/subtitles/translated.srt.
mazinger translate "https://youtube.com/watch?v=VIDEO_ID" \
--target-language Arabic \
--embed-subtitles \
--subtitle-google-font "Noto Sans Arabic" \
--subtitle-font-size 24 \
--base-dir ./outputEach pipeline stage has its own sub-command. This is useful when you want to inspect or modify intermediate output before continuing.
mazinger download "https://youtube.com/watch?v=VIDEO_ID" --base-dir ./output# Extract a clip
mazinger slice "https://youtube.com/watch?v=VIDEO_ID" --start 00:01:30 --end 00:05:00
# Dub only a portion of a video
mazinger dub "https://youtube.com/watch?v=VIDEO_ID" \
--clone-profile abubakr --target-language Arabic \
--start 00:01:30 --end 00:05:00# Cloud (OpenAI Whisper API)
mazinger transcribe ./output/projects/my-video/source/audio.mp3 -o subs.srt --method openai
# Cloud (Deepgram Nova 3 — free $200 credit, no card required)
export DEEPGRAM_API_KEY=your_key
mazinger transcribe audio.mp3 -o subs.srt --method deepgram --language ar
# Local with faster-whisper (default)
mazinger transcribe audio.mp3 -o subs.srt --method faster-whisper --device cuda
# Local with WhisperX (requires transcribe-whisperx extra)
mazinger transcribe audio.mp3 -o subs.srt --method whisperx --device cuda
# MLX Whisper (Apple Silicon, requires transcribe-mlx extra)
mazinger transcribe audio.mp3 -o subs.srt --method mlx-whispermazinger thumbnails \
--video video.mp4 \
--srt subs.srt \
--output-dir ./thumbsmazinger describe \
--srt subs.srt \
--thumbnails-meta ./thumbs/meta.json \
-o description.jsonmazinger translate \
--srt subs.srt \
--description description.json \
--thumbnails-meta ./thumbs/meta.json \
--target-language German \
-o translated.srtmazinger resegment --srt translated.srt -o final.srtmazinger speak \
--srt translated.srt \
--original-audio audio.mp3 \
--voice-sample speaker.m4a \
--voice-script speaker_transcript.txt \
-o dubbed.wavOr with a profile:
mazinger speak \
--srt translated.srt \
--original-audio audio.mp3 \
--clone-profile abubakr \
-o dubbed.wavOr with a voice theme:
mazinger speak \
--srt translated.srt \
--original-audio audio.mp3 \
--voice-theme warm-f \
-o dubbed.wavEvery stage caches its output files. If a run is interrupted — for example, during TTS synthesis on segment 47 of 200 — re-running the same command picks up where it left off. Already-completed stages and individual segment WAVs are skipped.
# Same command, just run it again
mazinger dub "https://youtube.com/watch?v=VIDEO_ID" \
--clone-profile abubakr \
--target-language ArabicTo discard all cached outputs and start fresh:
mazinger dub "https://youtube.com/watch?v=VIDEO_ID" \
--clone-profile abubakr \
--force-reset--force-reset also works with the speak sub-command to re-synthesize all TTS segments.
Add --tts-engine chatterbox to any command that involves voice synthesis:
mazinger dub "https://youtube.com/watch?v=VIDEO_ID" \
--clone-profile abubakr \
--tts-engine chatterbox
mazinger speak --srt translated.srt --original-audio audio.mp3 \
--voice-sample speaker.m4a \
--tts-engine chatterbox \
-o dubbed.wavChatterbox does not require a voice transcript (--voice-script), only the audio sample. It also supports emotion control:
mazinger speak --srt translated.srt --original-audio audio.mp3 \
--voice-sample speaker.m4a \
--tts-engine chatterbox \
--chatterbox-exaggeration 0.7 \
--chatterbox-cfg 0.3 \
-o dubbed.wavAdd --tts-engine mlx to use MLX-accelerated TTS (requires Apple Silicon):
mazinger dub "https://youtube.com/watch?v=VIDEO_ID" \
--clone-profile abubakr \
--tts-engine mlx
mazinger speak --srt translated.srt --original-audio audio.mp3 \
--voice-sample speaker.m4a \
--voice-script speaker_transcript.txt \
--tts-engine mlx \
-o dubbed.wavFor transcription with MLX Whisper:
mazinger transcribe audio.mp3 -o subs.srt --method mlx-whisperBy default, dubbed segments are placed at their original timestamps without speed adjustment. Use tempo flags to control pacing:
# Fixed speed-up: all segments 10% faster
mazinger speak --srt translated.srt --original-audio audio.mp3 \
--clone-profile abubakr \
--fixed-tempo 1.1 \
-o dubbed.wav
# Dynamic: per-segment speed to match original timing, max 1.3×
mazinger speak --srt translated.srt --original-audio audio.mp3 \
--clone-profile abubakr \
--dynamic-tempo --max-tempo 1.3 \
-o dubbed.wavfrom mazinger import MazingerDubber
from mazinger.profiles import fetch_profile
dubber = MazingerDubber(openai_api_key="sk-...", base_dir="./output")
# Option A: explicit voice files
proj = dubber.dub(
source="https://youtube.com/watch?v=VIDEO_ID",
voice_sample="speaker.m4a",
voice_script="speaker_transcript.txt",
target_language="Spanish",
)
# Option B: use a profile
voice, script = fetch_profile("abubakr")
proj = dubber.dub(
source="https://youtube.com/watch?v=VIDEO_ID",
voice_sample=voice,
voice_script=script,
target_language="Arabic",
output_type="video",
embed_subtitles=True,
)
print(proj.final_audio) # path to dubbed.wav
print(proj.final_video) # path to dubbed.mp4 (when output_type="video")
print(proj.summary()) # human-readable overview of all output filesSee Python API for the full reference.