Skip to content
BrobedaPublic
forked from xrun1/svp4mpv

About

SVP frame interpolation for mpv with built-in settings menu, no official GUI required

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

svp4mpv

An mpv script for Windows that provides SVP frame interpolation without having to use the official GUI. Comes with a menu for direct control:

Screenshot

SVP converts any video to 60+ FPS in real time as you watch it, with GPU acceleration supported. It can also fill black bars with lights when the monitor's aspect ratio and the video's differ.

This script makes use of the last SVPFlow DLL versions that could be extracted from the demo and used without requiring the GUI to be running. The LICENSE.txt in this repository does not cover the files in the third_party directory.

Not implemented:

  • Basic performance-quality slider (from looking at the original GUI's generated scripts, most levels changed absolutely nothing)
  • RIFE AI interpolation (too slow and complicated for little gained)
  • Automatic cropping of baked-in black bars (try dynamic-crop.lua)
  • Phoning home

Installation

Prerequisites

  1. VapourSynth Support: Your mpv build must support VapourSynth. This works out of the box with:

  2. Version Compatibility: VapourSynth R72 and VapourSynth R54 are confirmed to work with:

    • mpv 0.41 or mpv.net v7.1.2.0
    • mpv 0.37 or mpv.net v7.1.1.0

Method A: Quick Install (Windows)

Run this in PowerShell to launch the interactive installer:

irm https://raw.githubusercontent.com/Brobeda/svp4mpv/master/install.ps1 | iex

Method B: Manual Install

1. Download the Script

Clone this repository or click Code → Download ZIP. Extract the files into your mpv scripts directory:

  • Windows: %APPDATA%\mpv\scripts\svp4mpv

2. Set Up Portable VapourSynth

  1. Go to the VapourSynth R72 release page.
  2. Download these two files:
    • Install-Portable-VapourSynth-Rxx.bat
    • Install-Portable-VapourSynth-R72.ps1
  3. Create a new folder named vapoursynth-portable.
  4. Place both downloaded files into that folder.
  5. Run Install-Portable-VapourSynth-Rxx.bat to generate the portable environment.
  6. When prompted to install R72 or the latest stable release, choose R72.

3. Make VapourSynth Available to mpv (Windows)

Choose one of the following three options:

  • Option 1 (Recommended): Place inside the script folder
    Move the entire vapoursynth-portable folder into your script directory:
    %APPDATA%\mpv\scripts\svp4mpv\
    (Optionally, you can rename vapoursynth-portable to vapoursynth)

  • Option 2: Place in the mpv root directory
    Move all files and folders contained inside vapoursynth-portable directly into the mpv root directory where mpv.exe (or mpvnet.exe) is located.

  • Option 3: Add to system PATH

    ⚠️ Warning: Using this method may cause version conflicts with other software on your system that relies on VapourSynth, as this setup requires an older/specific version.

    To add the portable folder to your user environment variables, open PowerShell and run (replace C:\vapoursynth-portable with your actual path):

    [Environment]::SetEnvironmentVariable("Path", "C:\vapoursynth-portable" + ";" + [Environment]::GetEnvironmentVariable("Path","User"),"User")

4. Add keybinding line to input.conf

Alt+Shift+s script-binding svp4mpv/svp-menu You can change the hotkey to whatever you like.

⚠️ Warning: Left Alt + Shift toggles Switch Input Language in Windows. Another hotkey is recommended if you use multiple keyboard layouts.

5. Edit mpv.conf

If using hardware-accelerated video playback in mpv, the -copy version of the decoder must be used, e.g. hwdec=d3d11va-copy instead of hwdec=d3d11va.

6. Optional: UOSC button

If you have UOSC installed, you can add a button to your UOSC menu.

  1. Open script-opts\uosc.conf and look for the line starts with controls=.
  2. Add command:slow_motion_video:script-binding svp4mpv/svp-menu?SVP,gap at the desired position.
    For example:
    controls=menu,gap,<video,audio>subtitles,<has_many_audio>audio,<has_many_video>video,<has_many_edition>editions,<stream>stream-quality,gap,command:slow_motion_video:script-binding svp4mpv/svp-menu?SVP,gap,space,<video,audio>speed,space,shuffle,loop-playlist,loop-file,gap,prev,items,next,gap,fullscreen

Usage

  • Press Alt+Shift+S to open the menu
  • Press Enter to toggle interpolation on or off
  • Navigate options with the arrow keys or HJKL, reset selected with R
  • Press A to apply changes immediately
  • Changes are forgotten when mpv is closed unless you press S, then a file will be created in mpv's script-opts folder to remember your choices.
  • Press Escape or Q to close the menu.

More details about the options can be found on the SVP wiki. If you're in a hurry, try the settings from the above screenshot for maximum smoothness (the * indicates non-default settings). For options in the "Rendering" and "Motion vectors" sections, the choices are ordered from least (left) to most (right) CPU cost.

Framerate Options

The default multiplicand/multiplier settings pair try to be smart, for example: if you play a 24 FPS video on a 75hz screen, the script will multiply the framerate by exactly 3x to reach 72 FPS, as integer multipliers tend to give better results and 72 is right under 75.

However, if the screen is 60hz instead, then the multiplier will be 2.5 to reach exactly 60 FPS, since forcing 72 would cause stutter from dropped frames and the smoothness gained from 60 FPS in my opinion outweighs the benefits of using a 2x integer multiplier and getting only 48 FPS.

Most 60hz monitors can be easily overclocked to at least 72hz, which will make a noticeable difference for SVP.

If you have multiple monitors with different framerates, you may need to use mpv in full screen to avoid dropped frames.

Also note that if mpv is moved to another monitor, or the monitor's refresh rate is changed while mpv is open, mpv may stay stick with the old value, causing interpolation to target the wrong framerate. On laptops, beware of automatic changes on AC un/plugging (this can usually be disabled in your graphic chip's control panel).

Performance Issues

The menu displays a dropped frames/second estimation (averaged over the last 4 seconds) on the bottom, which should stay at/near 0 for smooth playback.

For weak hardware, the mpv rendering options can make a large difference. Hardware acceleration might actually degrade performance, e.g. with old Intel HD chips. Baseline settings to try:

vo=gpu-next
libplacebo-opts=preset=fast
hwdec=no

GPU acceleration and 10bit decoding in the SVP menu are important too. After that, the Motion Vectors section make the most difference. For animated content, using a larger motion vectors grid value (e.g. 24px) is essentially a free performance and quality increase.

About

SVP frame interpolation for mpv with built-in settings menu, no official GUI required

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages