Log in

View Full Version : Increasing FPS using mvtools 15->24


tsk1979
9th September 2015, 20:07
I am making a timelapse. In timelapse, clouds etc., do not move very fast, but still 15fps can look a bit jittery. Is it possible to use mvtools to increase fps to 24fps from 15fps while keeping duration of video same?

I used the 50fps script example as trial and it produced real strange artifacts. I tried to make my 20fps video as 50fps.

I guess 20->24 or 15->24 should be doable.

Do not worry much about the speed in virtualdub, but quality should be good

Alternatively. I am thinking of making 30fps, and then going 15fps slow motion smooth using mvtools. Is that a better approach?

raffriff42
9th September 2015, 21:40
Try Interframe (http://forum.doom9.org/showthread.php?t=160226) or SVP (http://forum.doom9.org/showthread.php?t=164554). They wrap MVTools with a lot of added value such as scene detection (interpolating across a scene change is really weird looking)InterFrame(Preset="medium", Tuning="Film", NewNum=24, NewDen=1, cores=4)EDIT the cores argument is mandatory in the newer versions. It's best set to the number of CPU cores in your machine.


But to answer your question, here is a basic MVTools2 script; it works really well for framerate doubling. With a little tweaking of the code in blue, it should do what you ask (but not as well as InterFrame or SVP)#######################################
function FastDoubler(clip C)
{
C # Last=C
super=MSuper(pel=2, hpad=0, vpad=0, rfilter=4)
MBlockFps(super,
\ MRecalculate(super,
\ MRecalculate(super,
\ MAnalyse(super,
\ blksize=16, search=3, searchparam=2,
\ plevel=0, badrange=(-24), isb=true),
\ blksize=8, searchparam=0, search=3),
\ blksize=4, searchparam=0, search=3),
\ MRecalculate(super,
\ MRecalculate(super,
\ MAnalyse(super,
\ blksize=16, search=3, searchparam=2,
\ plevel=0, badrange=(-24), isb=false),
\ blksize=8, searchparam=0, search=3),
\ blksize=4, searchparam=0, search=3),
\ num=FramerateNumerator*2, den=FramerateDenominator, mode=2)
return Last
}

luquinhas0021
9th September 2015, 21:54
Raffriff, increase fps is only possible if the frame n-1 and frame n are analised. In this case, the fps increaser would search for variates movements of pixel blocks and put the average into new frame(s) (This is the true fps increase). Am I right?

raffriff42
9th September 2015, 22:08
If I understand what you are saying, yes, basically.
http://avisynth.org.ru/mvtools/mvtools2.html

The plugin contains the motion estimation server-function MAnalyse to find the motion vectors and several motion compensation client-functions (MCompensate, MMask and others) which use these vectors.

Plugin uses block-matching method of motion estimation (similar methods are used in MPEG2, MPEG4, etc). At analysis stage plugin divides frames by small blocks and try to find for every block in current frame the most similar (matching) block in second frame (previous or next). The relative shift of these blocks is motion vector. The main measure of block similarity is sum of absolute differences (SAD) of all pixels of these two blocks compared. SAD is a value which says how good the motion estimation was. Note that MVTools is (cleverly) based on motion compensation (https://en.wikipedia.org/wiki/Motion_compensation) technology originally developed for video compression.

tsk1979
10th September 2015, 07:07
Try Interframe (http://forum.doom9.org/showthread.php?t=160226) or SVP (http://forum.doom9.org/showthread.php?t=164554). They wrap MVTools with a lot of added value such as scene detection (interpolating across a scene change is really weird looking)InterFrame(Preset="medium", Tuning="Film", NewNum=24, NewDen=1, cores=4)EDIT the cores argument is mandatory in the newer versions. It's best set to the number of CPU cores in your machine.


But to answer your question, here is a basic MVTools2 script; it works really well for framerate doubling. With a little tweaking of the code in blue, it should do what you ask (but not as well as InterFrame or SVP)#######################################
function FastDoubler(clip C)
{
C # Last=C
super=MSuper(pel=2, hpad=0, vpad=0, rfilter=4)
MBlockFps(super,
\ MRecalculate(super,
\ MRecalculate(super,
\ MAnalyse(super,
\ blksize=16, search=3, searchparam=2,
\ plevel=0, badrange=(-24), isb=true),
\ blksize=8, searchparam=0, search=3),
\ blksize=4, searchparam=0, search=3),
\ MRecalculate(super,
\ MRecalculate(super,
\ MAnalyse(super,
\ blksize=16, search=3, searchparam=2,
\ plevel=0, badrange=(-24), isb=false),
\ blksize=8, searchparam=0, search=3),
\ blksize=4, searchparam=0, search=3),
\ num=FramerateNumerator*2, den=FramerateDenominator, mode=2)
return Last
}


Thanks for your reply. Can you please tell me if the "*2" can be *1.5 or something. So I can make 15fps to something like 24fps.

Secondly, is SVP available for 64bit. My process takes around 2.5GB of RAM, so I am using 64bit virtualdub with 64bit avisynth

Music Fan
10th September 2015, 11:23
Can you please tell me if the "*2" can be *1.5 or something. So I can make 15fps to something like 24fps.
I believe you have to specify the new framerate like this ;
num=24, den=1
or
num=24000, den=1001
if you need 23.976 fps.
But I don't know if you have to change the mode value.

vivan
10th September 2015, 11:54
Thanks for your reply. Can you please tell me if the "*2" can be *1.5 or something. So I can make 15fps to something like 24fps.With Interframe you could do anything you want. However you should understand how frame interpolation works. To interpolate 15 fps to 24 fps it needs to interpolate it to 120 fps first (*8) and then select each 5th frame (/5), since 24 = 15 * 8 / 5. Which means that it will throw away 80% of the original frames and replace them with interpolated ones.
If you go to 30 fps instead it will not throw away anything, since it's simple doubling. For everything other than optical media (DVD/BD) it will be even better - most displays are 60hz and with 30fps video they have no stutter.
Or you can change speed of your timelapse to 12 fps - since it's timelapse it shouldn't really matter unless you've already timed everything and changing speed is not possible.

tsk1979
10th September 2015, 18:26
With Interframe you could do anything you want. However you should understand how frame interpolation works. To interpolate 15 fps to 24 fps it needs to interpolate it to 120 fps first (*8) and then select each 5th frame (/5), since 24 = 15 * 8 / 5. Which means that it will throw away 80% of the original frames and replace them with interpolated ones.
If you go to 30 fps instead it will not throw away anything, since it's simple doubling. For everything other than optical media (DVD/BD) it will be even better - most displays are 60hz and with 30fps video they have no stutter.
Or you can change speed of your timelapse to 12 fps - since it's timelapse it shouldn't really matter unless you've already timed everything and changing speed is not possible.
In that case 15-30fps should be best. 12fps I believe will be too slow!
I am looking for 64bit svp, can't find it. I guess I will try interframe.
Thanks!

luquinhas0021
10th September 2015, 18:49
Originally Posted by vivan
With Interframe you could do anything you want. However you
should understand how frame interpolation works. To interpolate
15 fps to 24 fps it needs to interpolate it to 120 fps first (*8) and
then select each 5th frame (/5), since 24 = 15 * 8 / 5. Which
means that it will throw away 80% of the original frames and
replace them with interpolated ones.
If you go to 30 fps instead it will not throw away anything, since
it's simple doubling. For everything other than optical media
(DVD/BD) it will be even better - most displays are 60hz and with
30fps video they have no stutter.
Or you can change speed of your timelapse to 12 fps - since it's
timelapse it shouldn't really matter unless you've already timed
everything and changing speed is not possible.

Or create one frame between two consecutive frames, 9 times, in 15 frames interval. Like this:
Before: of1, of2, of3, of4, of5, of6, of7, of8, of9, of10, of11, of12, of13, of14, of15 (of: original frame)
after: of1, if1, of2, if2, of3, of4, if4, of5, if5, of6, of7, if7, of8, of9, if9, of10, if10, of11, of12, of13, if13, of14, if14, of15 (if: interpolated frame)

feisty2
10th September 2015, 21:26
Something called "jerkiness" sweetheart

tsk1979
11th September 2015, 10:06
Thanks, It appears I should go for 15fps to 30fps.

I was looking at SVP page, and it says 64bit available. But I am unable to find it on the download page.
Any tips please?

luquinhas0021
11th September 2015, 12:16
from 15 to 30, just interpolate 1 frame between two consecutives, and predict the one that will be before last frame