Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Video-ESRGAN

Automate video upscaling with Real-ESRGAN & FFmpeg – extract, enhance, and merge frames in one simple script.

Do note

This is a fork of https://github.com/greatbody/Video-ESRGAN?tab=MIT-1-ov-file, I just added some features that the creator of that project developed.

Prerequisites

1. Download realesrgan-ncnn-vulkan

You need to download the realesrgan-ncnn-vulkan executable from the official Real-ESRGAN repository:

Download Link: https://github.com/xinntao/Real-ESRGAN/releases

  1. Go to the Real-ESRGAN releases page. For now V0.2.5.0 has final releases, unless you build it yourself.
  2. Download the appropriate version for your operating system:
    • Windows
    • macOS
    • Linux
  3. Extract the downloaded archive
  4. Place the realesrgan-ncnn-vulkan executable and the models directory in the same directory as the enlarge script.

For more information about Real-ESRGAN, visit the official repository.

2. Install FFmpeg

FFmpeg is required for video processing (extracting frames, merging frames back to video).

Windows

  • Download from FFmpeg official website
  • Or install via package manager:
    # Using Chocolatey
    choco install ffmpeg
    
    # Using Scoop
    scoop install ffmpeg

macOS

# Using Homebrew
brew install ffmpeg

# Using MacPorts
sudo port install ffmpeg

Linux

# 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 ffmpeg

Verify Installation

After installation, verify that both tools are available:

ffmpeg -version
./realesrgan-ncnn-vulkan -h

Usage

Basic Usage

To enhance a video, simply run the enlarge script with your input video file, if realesrgan-ncnn-vulkan exists in the same directory:

./enlarge input_video.mp4

Otherwise:

./enlarge -p /path/to/file/realesrgan-ncnn-vulkan input_video.mp4

What the Script Does

  1. Extracts frames from your input video using FFmpeg
  2. Enhances each frame using Real-ESRGAN with the realesr-animevideov3 model (2x upscaling)
  3. Merges enhanced frames back into a new video while preserving the original audio

Output

The script generates:

  • Enhanced video: input_video_enhanced.mp4 - Your upscaled video
  • Temporary folders:
    • tmp_frames_YYYYMMDD_HHMMSS/ - Original extracted frames
    • out_frames_YYYYMMDD_HHMMSS/ - Enhanced frames

Features

  • Progress tracking with real-time progress bar
  • Automatic framerate detection from source video
  • Audio preservation - copies original audio to enhanced video
  • Subtitles preservation - copies original subtitles to enhanced video
  • Unique timestamped outputs - prevents file conflicts
  • Automatic detection of threads - Making ffmpeg using multiple threads (on auto)

Example

# Make the script executable (first time only)
chmod +x enlarge

# Enhance a video
./enlarge my_video.mp4
# or
./enlarge my_video.mkv

# Output will be something like:
# enhanced_20241224_143052.mp4

Tips

  • The script uses the realesr-animevideov3 model 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)

About

This is a Fork to a project to automate video upscaling with Real-ESRGAN & FFmpeg – extract, enhance, and merge frames in one script.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages