A CLI tool to batch upscale anime videos using Real-CUGAN with GPU acceleration. Designed for Mac M4 (Metal via Vulkan/MoltenVK) but works on any platform with Vulkan support.
- Batch process MKV files from input directory
- Upscale using Real-CUGAN (optimized for anime)
- Preserve all audio tracks, subtitles, chapters, and font attachments
- Hardware-accelerated encoding (VideoToolbox on Mac)
- Resume interrupted jobs
- Progress reporting with ETA
- Optional Japanese-only audio filter
# macOS
brew install ffmpeg mkvtoolnix
# Linux (Debian/Ubuntu)
sudo apt install ffmpeg mkvtoolnix
# Linux (Arch)
sudo pacman -S ffmpeg mkvtoolnix-cliDownload the pre-built binary for your platform from: https://github.com/nihui/realcugan-ncnn-vulkan/releases
Extract and place the binary in one of these locations:
~/tools/realcugan-ncnn-vulkan(recommended)~/.local/bin/realcugan-ncnn-vulkan/usr/local/bin/realcugan-ncnn-vulkan- Or specify the path with
--realcugan-path
# Clone the repository
git clone https://github.com/yourusername/anime-upscaler.git
cd anime-upscaler
# Build and install
cargo install --path .# Basic usage
anime-upscaler -i ~/anime-input -o ~/anime-output
# With processed folder (moves originals after completion)
anime-upscaler -i ~/anime-input -o ~/anime-output -p ~/anime-processed
# 4x upscale with maximum denoise (slowest, best quality)
anime-upscaler -i ~/input -o ~/output -s 4 -n 3
# 2x upscale with no denoise (fastest)
anime-upscaler -i ~/input -o ~/output -s 2 -n -1
# Resume an interrupted job
anime-upscaler -i ~/input -o ~/output --resume
# Dry run (see what would be processed)
anime-upscaler -i ~/input -o ~/output --dry-run
# Verbose logging
anime-upscaler -i ~/input -o ~/output -v| Option | Default | Description |
|---|---|---|
-i, --input |
required | Input directory containing MKV files |
-o, --output |
required | Output directory for upscaled files |
-p, --processed |
none | Directory to move originals after processing |
-w, --work-dir |
system cache | Working directory for temporary files |
-s, --scale |
2 | Scale factor (2, 3, or 4) |
-n, --denoise |
1 | Denoise level (-1=none, 0, 1, 2, 3=max) |
-m, --model |
pro | Model to use (pro=quality, se=fast) |
-g, --gpu |
0 | GPU ID to use |
-t, --tile-size |
0 (auto) | Tile size (256/512/1024 if memory issues) |
-b, --bitrate |
20M | Video bitrate for output |
--codec |
hevc_videotoolbox | Video codec (use libx265 on Linux) |
--japanese-only |
true | Keep only Japanese audio tracks |
--realcugan-path |
auto-detect | Path to realcugan-ncnn-vulkan binary |
--resume |
false | Resume incomplete jobs |
--dry-run |
false | Show what would be done without processing |
-v, --verbose |
false | Enable verbose logging |
- Extract - Frames (PNG), audio tracks, subtitles, chapters, and font attachments
- Upscale - Process frames with Real-CUGAN using GPU
- Reassemble - Encode upscaled frames to video with hardware acceleration
- Mux - Combine video with preserved audio, subtitles, chapters, and fonts
Uses hevc_videotoolbox for hardware-accelerated H.265 encoding. Real-CUGAN uses Vulkan via MoltenVK for GPU acceleration.
Change the codec to libx265 for software encoding:
anime-upscaler -i ~/input -o ~/output --codec libx265Or use VAAPI/NVENC if available:
# NVIDIA
anime-upscaler -i ~/input -o ~/output --codec hevc_nvenc
# AMD/Intel VAAPI
anime-upscaler -i ~/input -o ~/output --codec hevc_vaapiReduce tile size:
anime-upscaler -i ~/input -o ~/output -t 256Use the faster model (slightly lower quality):
anime-upscaler -i ~/input -o ~/output -m seEnsure you use the same input/output directories and add --resume:
anime-upscaler -i ~/input -o ~/output --resumeMIT