View Full Version : 3fps to 25fps conversion
Terka
14th August 2006, 07:38
is there any way to convert 4fps to 25fps or 20fps using motion compensation and income "good looking" result? the imput is progressive.
Mug Funky
14th August 2006, 08:22
it might work for a talking head, but you'll never get the lipsync back.
Zep
14th August 2006, 08:22
motionperfect and framedoubler and MVflowFPS come to mind
also read this thread
http://forum.doom9.org/showthread.php?t=89601&highlight=framedoubler
mdkusr
15th August 2006, 03:10
Try DePan:
http://bag.hotmail.ru/depan/depan.dhtml
Using DePan for framerate change
DePan may be used as a tool for framerate converting and similar tasks.
For example, to change framerate with factor=1.5, from 16.6 fps progressive (old 8 mm film) to 25 fps, use script.
AviSource("kino.avi")
LoadPlugin("depan.dll")
i = ConvertToYV12()
data = DePanEstimate(i, range=1, trust=5)
f1_3 = DePan(i, data, offset=1./3)
b1_3 = DePan(i, data, offset=-1./3)
Interleave(f1_3, i, b1_3)
SelectEvery(6, 0, 1, 2)
It may by written as a function:
function fps2to3(clip) {
# change FPS from 2 to 3 (or 16.66 to 25, or 20 to 30 and so on), i.e. with factor=3/2
# uses global motion compensation
# input must be YV12 or YUY2 progressive (or separated fields probably ?)
data = DePanEstimate(clip)
f1_3 = DePan(clip, data, offset=1./3)
b1_3 = DePan(clip, data, offset=-1./3)
Interleave(f1_3, clip, b1_3)
SelectEvery(6, 0, 1, 2)
}
AviSource("e:\video.avi")
LoadPlugin("depan.dll")
ConvertToYV12()
fps2to3()
Here is a possible function for framerate converting (progressive) with factor=5/3, for example from 15 fps to 25 fps :
function fps3to5(clip) {
# change FPS from 3 to 5 (or 15 to 25, or 18 to 30 and so on), i.e. with factor=5/3
# uses global motion compensation
# input must be YV12 or YUY2 progressive (or separated fields probably ?)
data = DePanEstimate(clip)
t3_5 = DePan(clip, data, offset=-2./5)
t6_5 = DePan(clip, data, offset=1./5).trim(2,0)
t9_5 = DePan(clip, data, offset=-1./5).trim(1,0)
t12_5 = DePan(clip, data, offset=2./5).trim(3,0)
Interleave(clip, t3_5, t6_5, t9_5, t12_5)
SelectEvery(15,0,1,2,3,4)
}
AviSource("e:\video.avi")
LoadPlugin("depan.dll")
ConvertToYV12()
fps3to5()
Notes. There is more simple and general alternative method: try ChangeFPS with following DePanStabilize.
Trixter
15th August 2006, 04:00
I disagree with using depan for this. Wouldn't MVFlowFPS in MVTools be much better?
xyzdragon
24th July 2014, 23:41
I just wanted to post some updated versions of fpsXtoY, because the original versions are so counterintuitive, that I lost hours trying to understand them in order to write fps2to5 instead of fps3to5. (I'm more or less new to Avisynth) These functions here do actually also work if you omit the SelectEvery. In the functions above omitting that would lead to jitter, because the order of the frames is wrong.
function fps2to5(clip) {
data = DePanEstimate( clip, range=5, stab=-20 )
t0 = DePan( clip, data, offset=-0.4, mirror=15 ).DuplicateFrame(0)
t1 = DePan( clip, data, offset=-0.2, mirror=15 ).DuplicateFrame(0)
t2 = clip
t3 = DePan( clip, data, offset= 0.2, mirror=15 ).DeleteFrame(0)
t4 = DePan( clip, data, offset= 0.4, mirror=15 ).DeleteFrame(0)
res = Interleave( t0,t1,t2,t3,t4 )
FreezeFrame( res, res.framecount-5, res.framecount, res.framecount-6 )
DeleteFrame( res.framecount )
DeleteFrame( res.framecount-1 )
SelectEven()
}
function fps1to3(clip) {
data = DePanEstimate( clip, range=5, stab=-20 )
t0 = DePan( clip, data, offset=-1./3, mirror=15 )
t1 = clip.trim(1,0)
t2 = DePan( clip, data, offset=+1./3, mirror=15 ).trim(2,0)
Interleave( t0,t1,t2 )
}
-trims(in 1to3) and duplicate and deleteframe(in 2 to 5) are needed, because first interpolation for offset<0 is frame 1 to frame 0, but for offset>0 from frame -1 to frame 0, which will result in duplicating frame 0.
-FreezeFrame and so on used to geht exactly 50 frames out of 10 inputframes before selectEven. Didn't bother about timing here, could lead to some 1/60th lag in audio...
-stab and range should be adjusted. I used negative stab, to give large movements/pans more trust.
-last frames will be wrongly predicted. Especially noticeable, if clip ends on pan. Therefore the last frames will have to be deleted. All in all fps2to5 looses
(Btw: range doesn't seem to change much for me.)
@Trixter:
I need find DePan the best method for Anime, because it's the least intrusive, although it only works with pan zoom and rotation. SVPFlow (which is used by InterFrame) for example always messes up the frames by trying to move things locally. This is not what I want.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.