Skip to content

examples

Cyber Official edited this page Oct 22, 2025 · 7 revisions

Synthalingua Command-Line Examples

A practical, easy-to-read guide for common Synthalingua workflows. Copy, adapt, and experiment!


Table of Contents


1. Streaming (Twitch/YouTube/Other)

Basic: Translate a Japanese Twitch stream to English (GPU):

python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_language Japanese --stream_translate --device cuda

With Discord notifications:

python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_language Japanese --stream_translate --discord_webhook "https://discord.com/api/webhooks/1234567890/1234567890"

With blocklist and auto-blocklist:

python synthalingua.py --stream https://www.youtube.com/watch?v=abc123 --stream_language Japanese --stream_translate --ignorelist "C:/path/blacklist.txt" --auto_blocklist

Web server restricted to local machine (default):

python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_language Japanese --stream_translate --serverip 127.0.0.1 --portnumber 8080

With web server output (accessible on your network):

python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_language Japanese --stream_translate --serverip 0.0.0.0 --portnumber 8080

With cookies (for private/region-locked streams):

python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --cookies twitch

Stream with cookies from browser (Recommended):

# Extract cookies from Chrome
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --cookies-from-browser chrome

# Extract cookies from Firefox
python synthalingua.py --stream https://www.youtube.com/watch?v=abc123 --cookies-from-browser firefox

# Extract cookies from Edge
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --cookies-from-browser edge

Custom chunk size and padded audio (for better context):

python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_chunks 4 --paddedaudio 1

Select audio stream quality (YouTube):

python synthalingua.py --stream https://www.youtube.com/watch?v=abc123 --selectsource bestaudio

2. Microphone Input (Live Speech)

Transcribe and translate live microphone input to English:

python synthalingua.py --microphone_enabled --language ja --translate --device cuda

Set a specific microphone by index or name:

python synthalingua.py --microphone_enabled --set_microphone 2
python synthalingua.py --microphone_enabled --set_microphone "Microphone (Realtek USB2.0 Audi)"

With blocklist and auto-blocklist:

python synthalingua.py --microphone_enabled --ignorelist "C:/path/blacklist.txt" --auto_blocklist

With padded audio for better context:

python synthalingua.py --microphone_enabled --mic_chunk_size 3 --paddedaudio 1

Transcribe to a non-English target language:

python synthalingua.py --microphone_enabled --language en --transcribe --target_language es

List microphones and set by index:

python synthalingua.py --list_microphones
python synthalingua.py --microphone_enabled --set_microphone 3

3. File Captioning (Subtitles)

Basic: Generate English captions for a Japanese video file:

python synthalingua.py --makecaptions --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile" --language Japanese --device cuda

Compare all models for quality:

python synthalingua.py --makecaptions compare --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile" --language Japanese

With vocal isolation (removes music/noise, requires demucs):

python synthalingua.py --makecaptions --isolate_vocals --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"

With silence detection (faster for files with silent periods):

python synthalingua.py --makecaptions --silent_detect --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"

With custom silence threshold (for quiet speech):

python synthalingua.py --makecaptions --silent_detect --silent_threshold -45.0 --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"

With custom silence duration (ignore pauses under 2s):

python synthalingua.py --makecaptions --silent_detect --silent_duration 2.0 --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"

RECOMMENDED: Vocal isolation + silence detection:

python synthalingua.py --makecaptions --isolate_vocals --silent_detect --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"

RECOMMENDED: With custom settings for natural speech with pauses:

python synthalingua.py --makecaptions --isolate_vocals --silent_detect --silent_threshold -40.0 --silent_duration 1.5 --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"

With blocklist filtering:

python synthalingua.py --makecaptions --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile" --ignorelist "C:/path/blacklist.txt"

3.5. Adaptive Batch Processing (GPU/CPU Optimization)

Adaptive batch processing intelligently distributes transcription jobs between your GPU and CPU for maximum throughput. It automatically detects your hardware capabilities and optimizes job allocation for the fastest possible processing. This feature works by:

  • Auto-detecting available GPU VRAM capacity
  • Learning processing performance from initial batches
  • Sorting jobs by predicted time (long jobs → GPU, short jobs → CPU)
  • Allocating slots dynamically as jobs complete

When to use: Large files, batch processing, or when you want maximum hardware utilization. Requires FasterWhisper model source.

Key arguments:

  • --adaptive_batch: Enable intelligent GPU/CPU allocation
  • --batchjobsize: VRAM per job (0.1-12.0 GB, default 4.0)
  • --batchmode: Fixed parallel regions (1-4, legacy option)

Basic adaptive batch processing (auto-detect hardware):

python synthalingua.py --makecaptions --adaptive_batch --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"

Adaptive batch with custom model size (for large models like 11gb):

python synthalingua.py --makecaptions --adaptive_batch --batchjobsize 11.0 --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"

Adaptive batch with small model size (for tiny/base models):

python synthalingua.py --makecaptions --adaptive_batch --batchjobsize 0.5 --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"

Adaptive batch with vocal isolation (ultimate performance):

python synthalingua.py --makecaptions --adaptive_batch --isolate_vocals --silent_detect --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"

Compare all models with adaptive batch processing:

python synthalingua.py --makecaptions compare --adaptive_batch --batchjobsize 4.0 --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"

Adaptive batch for long videos (optimized for 6GB models):

python synthalingua.py --makecaptions --adaptive_batch --batchjobsize 6.0 --isolate_vocals --silent_detect --file_input "C:/Videos/long_video.mp4" --file_output "C:/Videos/captions" --file_output_name "LongVideoCaptions"

Adaptive batch for short clips (minimal VRAM usage):

python synthalingua.py --makecaptions --adaptive_batch --batchjobsize 0.8 --file_input "C:/Videos/short_clip.mp4" --file_output "C:/Videos/captions" --file_output_name "ShortClipCaptions"

Legacy parallel processing (fixed batch size):

python synthalingua.py --makecaptions --batchmode 2 --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/captions" --file_output_name "MyCaptionsFile"

Adaptive batch with custom silence settings (for podcasts):

python synthalingua.py --makecaptions --adaptive_batch --batchjobsize 4.0 --isolate_vocals --silent_detect --silent_threshold -40.0 --silent_duration 1.5 --file_input "C:/Videos/podcast.mp4" --file_output "C:/Videos/captions" --file_output_name "PodcastCaptions"

Adaptive batch with custom timeout for long jobs:

python synthalingua.py --makecaptions --adaptive_batch --batchjobsize 8.0 --timeout 1800 --file_input "C:/Videos/long_video.mp4" --file_output "C:/Videos/captions" --file_output_name "LongVideoCaptions"

Bulk processing multiple videos with timeout protection:

# Process video 1 with 15-minute timeout
python synthalingua.py --makecaptions --adaptive_batch --batchjobsize 4.0 --timeout 900 --file_input "C:/Videos/video1.mp4" --file_output "C:/Videos/captions" --file_output_name "Video1"

# Process video 2 with 10-minute timeout
python synthalingua.py --makecaptions --adaptive_batch --batchjobsize 4.0 --timeout 600 --file_input "C:/Videos/video2.mp4" --file_output "C:/Videos/captions" --file_output_name "Video2"

4. Video Subtitle Processing (Burn/Embed)

Basic burned subtitles (permanent overlay):

python synthalingua.py --makecaptions --subtype burn --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "MyVideo"

Embedded subtitles (toggleable track):

python synthalingua.py --makecaptions --subtype embed --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "MyVideo"

Custom styled burned subtitles:

# Large yellow text with custom font
python synthalingua.py --makecaptions --subtype burn --substyle "FiraSans-Bold.otf,28,yellow" --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "MyVideo"

# System font with custom size and color  
python synthalingua.py --makecaptions --subtype burn --substyle "22,cyan" --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "MyVideo"

# Custom font and size (default white color)
python synthalingua.py --makecaptions --subtype burn --substyle "FiraSans-UltraLightItalic.otf,20" --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "MyVideo"

# Color only (default font and size)
python synthalingua.py --makecaptions --subtype burn --substyle "red" --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "MyVideo"

# Flexible parameter order
python synthalingua.py --makecaptions --subtype burn --substyle "26,FiraSans-Bold.otf,magenta" --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "MyVideo"

Complete workflow with vocal isolation and custom styling:

python synthalingua.py --makecaptions --isolate_vocals --silent_detect --subtype burn --substyle "FiraSans-Bold.otf,24,orange" --file_input "C:/Videos/myvideo.mp4" --file_output "C:/Videos/output" --file_output_name "ProfessionalVideo"

Get styling help and see available fonts:

python synthalingua.py --substyle help

Setting up custom fonts:

  1. Create a fonts/ folder in your Synthalingua directory
  2. Download font files (.ttf, .otf, .woff, .woff2)
  3. Place font files in the fonts/ folder
  4. Reference the exact filename in --substyle

Popular free fonts to try:

  • Google Fonts: fonts.google.com
  • Open Font Library: fontlibrary.org
  • Font Squirrel: fontsquirrel.com

5. Saving Transcripts (Text Output)

Save transcript to a folder (always use both flags):

python synthalingua.py --save_transcript --save_folder "C:/transcripts"

6. Advanced & Troubleshooting

Check for updates:

python synthalingua.py --checkupdate

Stream with cookies using full path:

python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --cookies "C:/path/to/my/twitch_cookies.txt"

Stream with cookies from current directory:

python synthalingua.py --stream https://www.youtube.com/watch?v=abc123 --cookies youtube.txt

Show detected language of the stream:

python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_original_text

Legacy: Translate stream using deprecated argument (still supported):

python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_target_language English

For more details on each argument, see the other docs in this folder or the README.

Clone this wiki locally