-
-
Notifications
You must be signed in to change notification settings - Fork 24
examples
A practical, easy-to-read guide for common Synthalingua workflows. Copy, adapt, and experiment!
- 1. Streaming (Twitch/YouTube/Other)
- 2. Microphone Input (Live Speech)
- 3. File Captioning (Subtitles)
- 3.5. Adaptive Batch Processing (GPU/CPU Optimization)
- 4. Video Subtitle Processing (Burn/Embed)
- 5. Saving Transcripts (Text Output)
- 6. Advanced & Troubleshooting
Basic: Translate a Japanese Twitch stream to English (GPU):
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_language Japanese --stream_translate --device cudaWith 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_blocklistWeb 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 8080With 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 8080With cookies (for private/region-locked streams):
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --cookies twitchStream 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 edgeCustom chunk size and padded audio (for better context):
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_chunks 4 --paddedaudio 1Select audio stream quality (YouTube):
python synthalingua.py --stream https://www.youtube.com/watch?v=abc123 --selectsource bestaudioTranscribe and translate live microphone input to English:
python synthalingua.py --microphone_enabled --language ja --translate --device cudaSet 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_blocklistWith padded audio for better context:
python synthalingua.py --microphone_enabled --mic_chunk_size 3 --paddedaudio 1Transcribe to a non-English target language:
python synthalingua.py --microphone_enabled --language en --transcribe --target_language esList microphones and set by index:
python synthalingua.py --list_microphones
python synthalingua.py --microphone_enabled --set_microphone 3Basic: 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 cudaCompare 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 JapaneseWith 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"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"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 helpSetting up custom fonts:
- Create a
fonts/folder in your Synthalingua directory - Download font files (
.ttf,.otf,.woff,.woff2) - Place font files in the
fonts/folder - 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
Save transcript to a folder (always use both flags):
python synthalingua.py --save_transcript --save_folder "C:/transcripts"Check for updates:
python synthalingua.py --checkupdateStream 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.txtShow detected language of the stream:
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_original_textLegacy: Translate stream using deprecated argument (still supported):
python synthalingua.py --stream https://www.twitch.tv/somestreamerhere --stream_target_language EnglishFor more details on each argument, see the other docs in this folder or the README.