Skip to main content

Overview

Real-ESRGAN provides the realesr-animevideov3 model specifically optimized for anime video super-resolution. This lightweight model (XS size) is designed to process video frames efficiently while maintaining temporal consistency.

Quick Start

1

Download Model

2

Run Video Inference

3

Check Output

The enhanced video will be saved as input_video_out.mp4 in the results folder.

Model Specifications

realesr-animevideov3

Download URL:

Video Inference Script

The inference_realesrgan_video.py script is specifically designed for video processing with additional features:

Basic Usage

Multi-GPU and Multi-Processing

For faster processing, use multiple GPUs and processes:
The total number of processes = number of GPUs × num_process_per_gpuMulti-processing helps improve GPU utilization as video processing is often bottlenecked by I/O operations.

Command-Line Arguments

Video-Specific Options

string
required
Input video file, image, or folder of frames
string
default:"realesr-animevideov3"
Model to use. Options:
  • realesr-animevideov3 (recommended for anime videos)
  • RealESRGAN_x4plus_anime_6B
  • RealESRGAN_x4plus
  • Other image models
string
default:"results"
Output folder for the enhanced video
float
default:"4"
Final upsampling scale (1, 2, 3, or 4 recommended)
string
default:"out"
Suffix for output video filename
float
default:"None"
FPS of output video. If not specified, uses the input video’s FPS.
string
default:"ffmpeg"
Path to ffmpeg binary (use if ffmpeg is not in PATH)

Performance Options

integer
default:"1"
Number of processes per GPUIncrease this to improve GPU utilization. The program is often I/O bound, so GPUs are not fully utilized with a single process.
flag
Extract all frames first before processingUse this if you encounter ffmpeg errors during multi-processing.
integer
default:"0"
Tile size for processing. Use if you encounter CUDA out of memory errors.
integer
default:"10"
Tile padding size
integer
default:"0"
Pre-padding size at each border
flag
Use FP32 precision instead of FP16

Additional Options

flag
Enable GFPGAN face enhancement
Face enhancement is automatically disabled for anime models. It’s designed for realistic faces only.
float
default:"0.5"
Denoise strength (only for realesr-general-x4v3 model)

Advanced Workflows

Process video directly with automatic frame handling:
This automatically:
  1. Extracts frames using ffmpeg
  2. Processes frames with Real-ESRGAN
  3. Merges frames back into video with audio

Method 2: Extract-Process-Merge Workflow

Manual control over each step:
1

Extract Frames

This extracts frames with high quality (qscale:v 1) to avoid compression artifacts.
2

Process Frames

Use the standard image inference script:
Or use the video script with folder input:
3

Get Original FPS

Look for the fps value in the output (e.g., “23.98 fps”).
4

Merge Frames Back

Method 3: Using Extract Frame First

Use this if you encounter ffmpeg errors with multi-processing:
This extracts all frames first, then processes them in parallel.

NCNN Executable for Videos

For users who prefer the portable NCNN executable:
1

Download NCNN Executable

2

Extract Frames

3

Process with NCNN

4

Merge Frames

Performance Optimization

GPU Utilization

Improve GPU UsageVideo processing is often I/O bound. Use multiple processes to keep GPUs busy:
Monitor GPU usage with nvidia-smi to find the optimal number of processes.

Memory Management

High Resolution VideosFor 4K or higher resolution videos, the output size can be extremely large:
  • 1080p → 4K (4x): Very slow I/O
  • 4K → 8K+ (4x): Extremely slow, consider using smaller scale
Recommendation:

Using Tiling

For high-resolution videos that cause CUDA out of memory errors:

Tips for Best Results

Choose the Right Scale
  • 480p → 960p: Use -s 2
  • 480p → 1080p: Use -s 2.25 or -s 2.5
  • 720p → 1080p: Use -s 1.5
  • 1080p → 4K: Use -s 2 (avoid 4x for performance)
Input Video QualityBetter source quality = better results:
  • Use the highest quality source available
  • Avoid re-encoded or heavily compressed videos
  • If available, use Blu-ray rips over streaming captures
Output FormatFor best quality output:
  • Lower CRF = higher quality (18 is very high quality)
  • Slower preset = better compression

Troubleshooting

Use the --extract_frame_first option:
Solutions:
  1. Use tiling:
  2. Reduce processes per GPU:
  3. Use a smaller scale:
For large videos (>1080p output):
  1. Use multi-processing:
  2. Consider using multiple GPUs:
  3. Use smaller scale or lower resolution input
The script should automatically copy audio. If it doesn’t:
  1. Manually merge with audio:
  2. Check if original video has audio:

Model Comparison for Videos

For anime videos, realesr-animevideov3 is recommended due to its small size and optimization for video content.

Next Steps

Anime Images

Learn about the anime image model

NCNN Executable

Use portable executable for video frame processing

General Images

Explore models for non-anime content