Automate video upscaling with Real-ESRGAN & FFmpeg – extract, enhance, and merge frames in one click.
You need to download the realesrgan-ncnn-vulkan executable from the official Real-ESRGAN repository:
Download Link: https://github.com/xinntao/Real-ESRGAN/releases
- Go to the Real-ESRGAN releases page
- Download the appropriate version for your operating system:
- Windows
- macOS
- Linux
- Extract the downloaded archive
- Place the
realesrgan-ncnn-vulkanexecutable and themodelsdirectory in the same directory as theenlargescript.
For more information about Real-ESRGAN, visit the official repository.
FFmpeg is required for video processing (extracting frames, merging frames back to video).
- Download from FFmpeg official website
- Or install via package manager:
# Using Chocolatey choco install ffmpeg # Using Scoop scoop install ffmpeg
# Using Homebrew
brew install ffmpeg
# Using MacPorts
sudo port install ffmpeg# Ubuntu/Debian
sudo apt update
sudo apt install ffmpeg
# CentOS/RHEL/Fedora
sudo yum install ffmpeg
# or
sudo dnf install ffmpeg
# Arch Linux
sudo pacman -S ffmpegAfter installation, verify that both tools are available:
ffmpeg -version
./realesrgan-ncnn-vulkan -hTo enhance a video, simply run the enlarge script with your input video file:
./enlarge input_video.mp4- Extracts frames from your input video using FFmpeg
- Enhances each frame using Real-ESRGAN with the
realesr-animevideov3model (2x upscaling) - Merges enhanced frames back into a new video while preserving the original audio
The script generates:
- Enhanced video:
enhanced_YYYYMMDD_HHMMSS.mp4- Your upscaled video - Temporary folders:
tmp_frames_YYYYMMDD_HHMMSS/- Original extracted framesout_frames_YYYYMMDD_HHMMSS/- Enhanced frames
- ✅ Progress tracking with real-time progress bar and ETA
- ✅ Automatic framerate detection from source video
- ✅ Audio preservation - copies original audio to enhanced video
- ✅ Unique timestamped outputs - prevents file conflicts
- ✅ Error handling with detailed feedback
- ✅ Processing statistics - shows total time and frames processed
# Make the script executable (first time only)
chmod +x enlarge
# Enhance a video
./enlarge my_video.mp4
# Output will be something like:
# enhanced_20241224_143052.mp4- The script uses the
realesr-animevideov3model which works well for anime/cartoon content - Processing time depends on video length, resolution, and your hardware
- You can safely delete the temporary frame folders after processing
- For best results, ensure your input video has good quality (not heavily compressed)
Check the example/ directory for sample input and output files to test the script.