Skip to content

Instantly share code, notes, and snippets.

@edjdavid
Created August 13, 2020 12:39
Show Gist options
  • Save edjdavid/8ad0445042c4ca4fa66e4055f2cbfc3b to your computer and use it in GitHub Desktop.
Save edjdavid/8ad0445042c4ca4fa66e4055f2cbfc3b to your computer and use it in GitHub Desktop.
PotPlayer Motion Interpolation

Motion Interpolation

Interpolate 24fps videos to 60fps in PotPlayer

Download and install the latest AviSynth+ (with vcredist)
https://github.com/AviSynth/AviSynthPlus/releases

Download the latest MvTools
https://github.com/pinterf/mvtools/releases

Extract x64 from the archive (DePan.dll, DePanEstimate.dll, mvtools2.dll) to C:\Program Files (x86)\AviSynth+\plugins64\ (adjust the avs script if avisynth is not installed in this directory)

In PotPlayer:

Preferences
  -> Filter Control
    -> Video Decoder
      -> Built-in Video Codec/DXVA Settings
        -> Use DXVA
          -> Checked
        -> DXVA2 Copy-Back
          -> Select D311 with the GPU
  -> Avisynth
    -> Enable AviSynth processing
      -> Checked
    -> Add "potplayer_source()"
      -> Checked
    -> Leave other checkboxes on default
    -> Load Script
      -> Select or copy the avs script below

avisynthplus_motion_interp.avs

SetMemoryMax(512)
SetFilterMTMode("DEFAULT_MT_MODE", 2)
SetFilterMTMode("FFVideoSource", 3)
potplayer_source()
LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins64\mvtools2.dll")
super=MSuper(pel=1, hpad=0, vpad=0)
backward_1=MAnalyse(super, chroma=false, isb=true, blksize=32, blksizev=32, searchparam=3, plevel=0, search=3, badrange=(-24))
forward_1=MAnalyse(super, chroma=false, isb=false, blksize=32, blksizev=32, searchparam=3, plevel=0, search=3, badrange=(-24))
backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, blksizev=8, searchparam=0, search=3)
forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=8, blksizev=8, searchparam=0, search=3)
MBlockFps(super, backward_2, forward_2, num=60, den=1, mode=2)
Prefetch(4)
@ranvotu
Copy link

ranvotu commented Jan 11, 2023

How can I use this with LAV Video Decoder instead

@captain-k4
Copy link

I think for the above script, It only doubles th file source fps. that's the best you can get after I test it.

@sdanielch
Copy link

Hey! you are the best, im testing this metod in 2023 with RTX3060, all right! of course this run very well in Windows (i was config your script for sync with my screen 144fps), maybe in some videos audio de-sync but in potplayer you can "resync" on the fly and voila!, great tutorial!

Do you know a similar method for Linux? Thanks!!

@DarkKingTNi
Copy link

this work good for highend pc in 4k
but not work so well in loptop with intel gpu in 4k video
even with increasing the ram to 10240 mb
any solution for me??
my spec lop top : intel i7 1165g7 - intel iris xe share to 8gb - 16gb ram
pls help me tnx

@bryannetrunner
Copy link

Hi edjdavid, I've just configured this with PotPlayer and the result is shockingly good.

I have a question: I often watch videos at 1.25 or 1.5 speed, so for example 24fps becomes 36fps at 1.5X. The script does not know the playback speed and hence the video becomes 75fps (see attached screenshot). Is it possible to take the current playback speed into account to maintain 60fps even if the playback speed changes?

image

@RickyWong19922005
Copy link

SetMemoryMax(51200000)
SetFilterMTMode("DEFAULT_MT_MODE", 2)
SetFilterMTMode("FFVideoSource", 3)
potplayer_source()
LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins64\mvtools2.dll")
super=MSuper(pel=1, hpad=0, vpad=0)
backward_1=MAnalyse(super, chroma=false, isb=true, blksize=32, blksizev=32, searchparam=3, plevel=0, search=3, badrange=(-24))
forward_1=MAnalyse(super, chroma=false, isb=false, blksize=32, blksizev=32, searchparam=3, plevel=0, search=3, badrange=(-24))
backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, blksizev=8, searchparam=0, search=3)
forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=8, blksizev=8, searchparam=0, search=3)
MBlockFps(super, backward_2, forward_2, num=156, den=1, mode=2)
Prefetch(32)

I edit this script can run to 144fps
Just change the "num=" to target fps

@RickyWong19922005
Copy link

I have a problem
When I use mvtools the video out will decreased to nv12(8bit)
How can I edit to keep 10bit output
thanks

@gigend
Copy link

gigend commented Jan 19, 2025

worked, but i want to ask, when using this, my CPU works harder than VGA, how do to make the VGA work optimally and minimize the load on CPU? btw, my VGA is Nvidia RTX. It should be possible, right, with the increasingly advanced technology now?

@ThreeDeeJay
Copy link

I could never get this script working right, so I just kept using SVP3 (last free version).
If anyone wants to give it a shot, this is made mainly for 3D movies but it can still be used as a regular player: https://github.com/ThreeDeeJay/PotPlayer3D/releases/latest

@MarkZaytsev
Copy link

Worked for me like a charm. Win11, Nvidia GPU. Managed to lerp 24 fps to 120 fps. Looks awesome on my 120 hz TV)
I used the original script, but had to tweak some parameters in the script to keep performance stable. Because if fps gets unstable - audio quickly gets out of sync with video.

First tweak was to set more memory. I'm not sure if I really used that much, but doesn't hurt for sure.
SetMemoryMax(4096)

Second tweak was suggested by captain-k4. It's much better than hardcode amount of CPUs
Prefetch(#CPUS)

Overall I'm very happy that I've discovered that topic. This is super useful. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment