Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 9th September 2015, 20:07   #1  |  Link
tsk1979
Registered User
 
Join Date: Nov 2013
Posts: 30
Increasing FPS using mvtools 15->24

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?
tsk1979 is offline   Reply With Quote
Old 9th September 2015, 21:40   #2  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
Try Interframe or SVP . They wrap MVTools with a lot of added value such as scene detection (interpolating across a scene change is really weird looking)
Code:
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)
Code:
#######################################
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
}

Last edited by raffriff42; 9th September 2015 at 22:02.
raffriff42 is offline   Reply With Quote
Old 9th September 2015, 21:54   #3  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
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?
__________________
Searching for great solutions
luquinhas0021 is offline   Reply With Quote
Old 9th September 2015, 22:08   #4  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
If I understand what you are saying, yes, basically.
Quote:
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 technology originally developed for video compression.

Last edited by raffriff42; 9th September 2015 at 22:17.
raffriff42 is offline   Reply With Quote
Old 10th September 2015, 07:07   #5  |  Link
tsk1979
Registered User
 
Join Date: Nov 2013
Posts: 30
Quote:
Originally Posted by raffriff42 View Post
Try Interframe or SVP . They wrap MVTools with a lot of added value such as scene detection (interpolating across a scene change is really weird looking)
Code:
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)
Code:
#######################################
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

Last edited by tsk1979; 10th September 2015 at 07:09.
tsk1979 is offline   Reply With Quote
Old 10th September 2015, 11:23   #6  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,744
Quote:
Originally Posted by tsk1979 View Post
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 ;
Code:
num=24, den=1
or
Code:
num=24000, den=1001
if you need 23.976 fps.
But I don't know if you have to change the mode value.
Music Fan is offline   Reply With Quote
Old 10th September 2015, 11:54   #7  |  Link
vivan
/人 ◕ ‿‿ ◕ 人\
 
Join Date: May 2011
Location: Russia
Posts: 643
Quote:
Originally Posted by tsk1979 View Post
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.
vivan is offline   Reply With Quote
Old 10th September 2015, 18:26   #8  |  Link
tsk1979
Registered User
 
Join Date: Nov 2013
Posts: 30
Quote:
Originally Posted by vivan View Post
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!
tsk1979 is offline   Reply With Quote
Old 10th September 2015, 18:49   #9  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
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)
__________________
Searching for great solutions

Last edited by luquinhas0021; 11th September 2015 at 01:44.
luquinhas0021 is offline   Reply With Quote
Old 10th September 2015, 21:26   #10  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Something called "jerkiness" sweetheart
feisty2 is offline   Reply With Quote
Old 11th September 2015, 10:06   #11  |  Link
tsk1979
Registered User
 
Join Date: Nov 2013
Posts: 30
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?
tsk1979 is offline   Reply With Quote
Old 11th September 2015, 12:16   #12  |  Link
luquinhas0021
The image enthusyast
 
Join Date: Mar 2015
Location: Brazil
Posts: 270
from 15 to 30, just interpolate 1 frame between two consecutives, and predict the one that will be before last frame
__________________
Searching for great solutions
luquinhas0021 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:44.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.