the-database/mpv-AnimeJaNai

Real-time anime upscaling to 4K in mpv with lightweight super-resolution models

What it solves

This project addresses the loss of image clarity and scaling artifacts found in anime videos that were upscaled to 1080p during distribution. It provides a way to upscale anime content in real-time to 4K resolution, making it appear as if it were originally mastered in 4K.

How it works

The project combines a custom build of the mpv video player with a collection of Real-ESRGAN Compact ONNX models. It uses TensorRT (for NVIDIA GPUs) or DirectML (for AMD and Intel Arc GPUs) to run these models during playback, allowing for real-time upscaling. Users can switch between different quality profiles (Quality, Balanced, and Performance) depending on their hardware capabilities.

Who it’s for

Anime enthusiasts who want to improve the visual quality of their local video files using high-end GPUs (specifically NVIDIA RTX 3060 or higher for 1080p to 4K upscaling).

Highlights

  • Real-time 4K Upscaling: Upscales 1080p anime to 4K on the fly during playback.
  • Custom Model Collection: Includes specialized 2x_AnimeJaNai HD and SD models trained to handle oversharpening, ringing, and aliasing.
  • Hardware Flexibility: Supports NVIDIA GPUs via TensorRT and AMD/Intel Arc GPUs via DirectML.
  • C customizable Profiles: Includes a manager for setting up custom upscaling chains, resolution-based settings, and downscaling for performance.
  • Experimental Refresh Rate Matching: Can automatically adjust display refresh rates to match video timestamps for smoother playback on Windows.

Related

  • Project
  • Project
  • Project
  • Project
  • Project