A terminal-based user interface application for anime dubbing pipelines, built with OpenTUI.
- Currently, the tts model isn't working well with music. i think that you should using this tool with podcast or speech only video for archive the best result.
- Also i recommend you using minimax tts (currently is default config) for the predictable result because qwen-tts sometime crashing and output unpredictable audio quality
- Sometimes the errors might cause by your api balance so i recommend you using small video to test (to know how much you should spend for that length of video) before using on long video (about 2$/minute)
- Pipeline System: Execute 10-step dubbing pipelines with real-time progress tracking
- Terminal UI: Beautiful CLI interface using OpenTUI
- Log Viewer: Real-time log display with keyboard scrolling support (up/k, down/j)
- Cancellation: Press Ctrl+C to cancel pipeline execution at any time
- Checkpoint/Resume: Automatically saves progress; resumes from last completed step on re-run
- SRT Export: Save subtitles with
--subtitleDirectoryor-Sflag - Background Audio Preservation: Mixes TTS with original audio at 25% volume
- FFmpeg Integration: Built-in audio/video processing using fluent-ffmpeg
- Bun (v1.0+) - JavaScript runtime and package manager
- FFmpeg - Media file converter (bundled automatically via ffmpeg-static)
bun installSecurity Note: The .env file is ignored by git (see .gitignore) to prevent accidentally committing secrets. Never commit your actual API keys.
- Copy the template:
cp .env.example .env - Edit
.envand add yourREPLICATE_API_TOKENandHACK_CLUB_AI_API_KEY.REPLICATE_API_TOKENfrom replicate.com (or use HackClub Ai proxy (extreme recommendation solution))HACK_CLUB_AI_API_KEYfrom ai.hackclub.com
- Keep the file private - never commit
.envto version control.
The other variables are optional and have sensible defaults.
Environment Variables:
| Variable | Required | Description | Default |
|---|---|---|---|
REPLICATE_API_TOKEN |
Yes | API token for Replicate (transcription & TTS)TTS) | - |
HACK_CLUB_AI_API_KEY |
Yes | API key for OpenRouter/HackClub AI (translation) | - |
REPLICATE_BASE_URL |
No | Custom Replicate API endpoint | https://ai.hackclub.com/proxy/v1/replicate |
HACK_CLUB_AI_BASE_URL |
No | Custom OpenRouter-compatible endpoint | https://ai.hackclub.com/proxy/v1 |
HF_TOKEN |
No | HuggingFace token for speaker diarization (feature disabled by default) | - |
Development mode (with Bun):
bun run src/index.tsx dubbing --inputFile video_file>gt; --outputFile output_file>gt; Production (after building):
# Windows
..\anime-dubbing.exe dubbing -i video_file>gt; -o output_file>gt;
# Linux/macOS
./anime-dubbing dubbing -i video_file>gt; -o output_file>gt; Example (with all options):
.\anime-dubbing.exe dubbing ^
-i ..\sample\test.mp4 ^
-t ..\tmp\pipeline\tmp\ ^
-o ..\tmp\pipeline\output\out.mp4 ^
-s ja ^
-l en ^
-S .S .\tmp\pipeline\output\subtitle ^
--tts-mode "minimax"(Use \ for line continuation on Windows or \ on Unix-like systems)
| Option | Description | Default |
|---|---|---|
--inputFile, -i |
Input video file (required) | - |
--outputFile, -o |
Output video file | output.mp4 |
--tmpDirectory, -t |
Temp directory for processing | ./tmp |
--targetLanguage, -l |
Target language for dubbing | en |
--sourceLanguage, -s |
Source language (auto-detect if not set) | auto |
--subtitleDirectory, -S |
Directory to save SRT subtitles | (optional) |
dubbing- Dub video with AI-generated voicehelp- Show help information
- Ctrl+C - Cancel pipeline execution
- Up / k - Scroll up in log viewer (older logs)
- Down / j - Scroll down in log viewer (newer logs)
anime-dubbing/
├── src/
│ ├── class/
│ │ └── replicate.ts # ReplicateUtil for AI processing
│ ├── commands/
│ │ ├── dubbing.tsx # Dubbing command entry point
│ │ ├── help.tsx # Help command
│ │ └── index.ts # Command exports
│ ├── components/
│ │ ├── LogViewer.tsx # Log display with scrolling
│ │ └── PipelineProgress.tsx # Step progress display
│ ├── convert/
│ │ └── ffmpeg.ts # FFmpeg processing utilities
│ ├── hooks/
│ │ └── usePipelineLogger.ts # Log storage hook
│ ├── pages/
│ │ └── PipelineApp.tsx # Main pipeline execution page
│ ├── pipelines/
│ │ ├── dubbing.ts # 10-step dubbing pipeline
│ │ └── index.ts # Pipeline exports
│ ├── types/
│ │ ├── checkpoint.ts # Checkpoint type definitions
│ │ └── pipeline.ts # Pipeline type definitions
│ ├── utils/
│ │ ├── audioSplit.ts # Silence detection/splitting
│ │ ├── checkpoint.ts # Checkpoint save/load
│ │ ├── cliRenderer.ts # CLI rendering utilities
│ │ ├── logger.ts # Logging utility
│ │ ├── pipelineRunner.ts # Pipeline execution
│ │ └── voice.ts # Voice processing utilities
│ └── index.tsx # Application entry point
├── package.json
└── README.md
ckage.json
└── README.md
- Bun (v1.0+) - JavaScript runtime and package manager
- FFmpeg - Media processing (bundled via
ffmpeg-static)
Two API tokens are required:
REPLICATE_API_TOKENfrom replicate.com for transcription and TTS services.HACK_CLUB_AI_API_KEYfrom ai.hackclub.com for translation via OpenRouter.
The application uses HackClub's proxy to access these models.
See the Installation section for the full list of configurable environment variables.
# Run in development mode with watch
bun run dev
# Run in production (direct execution)
bun run start
# Type check
bun run typecheck
# Lint code
bun run linttFor building distributable executables, see Build & Distributiontion.
Build a single executable that bundles Bun runtime and all dependencies:
# Windows (default target)
bun build src/index.tsx --outfile anime-dubbing.exe --compile
# Linux
bun build src/index.tsx --outfile anime-dubbing --compile --target bun-linux-x64
# macOS (Intel)
bun build src/index.tsx --outfile anime-dubbing --compile --target bun-macos-x64
# macOS (Apple Silicon)
bun build src/index.tsx --outfile anime-dubbing --compile --target bun-macos-arm64
# Cross-compile for multiple platforms (requires Docker)
bun build src/index.tsx --outfile anime-dubbing --compile --target bun-linux-x644Build Options:
| Flag | Description |
|---|---|
--outfile |
Output executable name |
--compile |
Create standalone executable (bundles Bun runtime) |
--minify |
Minify output to reduce size |
--target |
Target platform (bun-windows-x64, bun-linux-x64, bun-macos-x64, bun-macos-arm64) |
The standalone executable includes:
- Bun runtime (~60 MB)
- FFmpeg static binary (~40 MB)
- All JavaScript dependencies
Total size: ~100-120 MB (before minification). Use --minify to reduce size by ~30%.
After building, distribute the executable along with:
- The
.env.exampletemplate (users must create their own.envwithREPLICATE_API_TOKENandHACK_CLUB_AI_API_KEY) - Any required runtime libraries (none for standalone builds)
Example distribution structure:
anime-dubbing/
├── anime-dubbing.exe # Built executable (Windows)
├── .env.example # Environment template
├── README.md # This file
└── LICENSE
NSE
Running the packaged app:
# Windows
..\anime-dubbing.exe dubbing --inputFile video.mp4 --outputFile output.mp4
# Linux/macOS
./anime-dubbing dubbing --inputFile video.mp4 --outputFile output.mp44FFmpeg binary not found:
The ffmpeg-static package bundles FFmpeg automatically. If missing, reinstall:
bun install ffmpeg-static --saveCross-compilation fails: Some native modules may need rebuilding for the target platform. Clean and rebuild::
bun pm cache -g
bun build src/index.tsx --outfile anime-dubbing --compile --target platform>gt; MIT