the-database/mpv-AnimeJaNai

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

mpv-AnimeJaNai — Plain-English Explainer

What it is

A Windows-only video player package (a custom build of the open-source mpv player) bundled with AI upscaling models that double video resolution in real time — typically from 1080p to 4K.

What it does

  • Plays anime videos and upscales them live as they play, using AI models.
  • Works on NVIDIA GPUs (via TensorRT) or AMD / Intel Arc GPUs (via DirectML).
  • Ships with three ready-made quality/performance profiles you can switch with keyboard shortcuts.

How it works

  • The models are Real-ESRGAN Compact ONNX files — a compact AI architecture designed for fast upscaling.
  • On first playback of a video, the player builds an engine file for the selected model (this pauses playback and opens a command prompt — wait for it to finish; it only happens once per model).
  • Press Ctrl+J to see upscaling stats (current profile, active models).

Default profiles

Profile Purpose Key Minimum recommended GPU (for 1080p→4K)
Quality Highest quality Shift+1 RTX 4090
Balanced Slight quality loss, big speed gain Shift+2 RTX 3080
Performance Fastest, more quality loss Shift+3 RTX 3060

The default is Balanced.

Customization

  • Press Ctrl+E to open the AnimeJaNai Manager — lets you set up to 9 custom slots, custom model chains, conditional settings based on resolution/framerate, downscaling for performance, and change the default profile.
  • Add mpv settings to mpv-user.conf (applied last, never overwritten on update).
  • Add custom keybindings to input-user.conf (same syntax as input.conf).
  • Screenshots: press s — saved to portable_config/screenshots.

Updating

  • The player checks for updates on startup; press Ctrl+U (or menu: AnimeJaNai > Install Update) to install in place.
  • Your customizations (profiles, mpv settings, added ONNX models) are preserved across updates.
  • Old input.conf is backed up as input.conf.bak-<version> before shipped keybindings refresh.
  • If you're on a version older than the updater, download the latest release once manually; after that, updates are automatic.

Experimental feature: Automatic Display Refresh Rate (Windows)

  • Off by default; enable in Manager's Profiles tab and restart.
  • Scans video timestamps before playback and picks one display refresh rate for the whole episode, even across seeks.
  • Fixed-rate videos prefer exact/near multiples; mixed-rate videos pick a common multiple or minimize timing error.
  • Pauses briefly before a switch, resumes after settling; restores original refresh at end/exit.
  • Does not interpolate video or change video-sync; may cause a brief black screen on your TV.
  • Requires all three components: Manager, the native mpv player with display-rate-match, and scripts/animejanai_backend.lua.

The AI models

  • 2x_AnimeJaNai HD V3 — trained for HD anime (production resolution is often 720p–1080p, then scaled to 1080p by distributors, causing artifacts). The V3 models fix scaling/blur artifacts and aim to look like the anime was originally mastered in 4K. Trained over 7 months with 100+ release candidates; improvements include more faithful appearance, better handling of oversharpening/ringing/aliasing, preserving intentional depth-of-field blur, accurate line colors/darkness/thickness, and soft shadow edges.
  • 2x_AnimeJaNai SD V1 — early beta for SD anime (upscales SD to look like HD). Can be stacked with HD models (with enough hardware) to go SD→4K.

Other uses

  • Other media players: any player supporting external DirectShow filters can run these models via avisynth_filter + VapourSynth.
  • Prerendering (not real-time): use the ONNX models on any GPU to render upscaled video files — via AnimeJaNaiConverterGui (Windows GUI), chaiNNer, or VSGAN-tensorrt-docker (multi-platform).

Related projects

  • MangaJaNai — upscale manga with ESRGAN models
  • VideoJaNai — Windows GUI for fast video upscaling
  • traiNNer-redux — software for training upscaling models

Notes

  • AMD / Intel Arc users: switch to DirectML (see wiki page for instructions).
  • Benchmarks for various hardware/configs are on the wiki.
  • Community/support: JaNai Discord server (Japanese OK).

Related

  • Project
  • Project
  • Project
  • Project
  • Project