View Full Version : Best overall framedoubler
colemar
7th February 2005, 15:48
Some days ago I had to convert some WMV clips from 15 fps to 30 fps, maintaining clip duration.
I didn't want to simply repeat frames, instead I needed some solution to generate in-between frames. This requires motion estimation.
Motionperfect does just that with good results, but it is so much cumbersome: it reads only AVI files, it crashes or misses the length when I try to feed it with an AVS script.
The best overall solution was the following two Avisynth scripts:
DirectShowSource("097.wmv", fps=15)
#ConvertToYV12()
b=MVAnalyse(isb=true)
f=MVAnalyse(isb=false)
g=MVConvertfps(last,b,f,fps=30)
Interleave(last,SelectOdd(g))
DirectShowSource("097.wmv", fps=15)
#ConvertToYV12()
b=MVAnalyse(isb=true)
f=MVAnalyse(isb=false)
g=MVInterpolate(last, b, f, nb=1, bl=0.5, el=0.5, fbw=4).Trim(1,0)
Interleave(last,g)
Both scripts maintain the original frames which show as frames 0,2,4,... in the final clip, while 1,3,5... are the generated frames.
The second script is a bit less CPU intensive and probably gives better quality.
The scripts requires MVTools by Manao.
I use version 0.9.5.3 to be found at http://jourdan.madism.org/~manao/
For some reason the function MVConvertFPS and MVInterpolate disappeared after version 0.9.5.3.
I have been unable to obtain good results with version 0.9.7 and combining MVAnalyse/MVCompensate.
DeathTheSheep
21st February 2005, 16:42
Wow, nice. I wonder if someone could stick this into a seperate function.
Thing is, it shows some artifacts when converting 23.976fps anime into 47fps....
Still, smooth. Why not triple the frame rate? I find this to be excellent at smoothing out choppy motion as well. Perhaps the newer versions took out such commands and replaced them with an fps changer? I think I saw something like that in the docs...
colemar
22nd February 2005, 12:37
Artifatcs are almost inavoidable since I believe in MVTools motion estimation is macroblock based. A perhaps better motion estimation should be based on edge/contour detection and morphing.
I found some tweaking of sx, sy and lambda parameters that seems to improve quality.
Tripling the frame rate, still maintaining original frames:
o=<original clip>
b=o.MVAnalyse(isb=true, sx=4,sy=4, lambda=4000)
f=o.MVAnalyse(isb=false, sx=4,sy=4, lambda=4000)
g0=MVInterpolate(o, b, f, nb=1, bl=0.77, el=0.33, fbw=4).Trim(1,0)
g1=MVInterpolate(o, b, f, nb=1, bl=0.33, el=0.77, fbw=4).Trim(1,0)
Interleave(o,g0,g1)
In the output clip:
0,3,6,... are original frames
1,4,7,... are generated frames (interpolated at time 1/3)
2,5,8,... are generated frames (interpolated at time 2/3)
Tripling should be useful only when original frame rate is 10 fps or less, since I believe 30 fps should be enough to look as continuous to any human observer.
Manao wrote "temporal interpolators are disabled for version > 0.9.5, because they are being rewritten"
http://forum.doom9.org/showthread.php?s=&threadid=84770
2Bdecided
22nd February 2005, 12:54
Any Philips PixelPlus TV will do a better job of doubling frame rate (25fps to 50fps in PAL countries) than either MotionPerfect or mvtools - it's just a pity you can't access the output!
They've been doing it in hardware for several years - I wonder what's so clever/different about their algorithm? It seems that it only interpolates sometimes, and doesn't bother at other times, which may trade artefacts for motion judder.
Cheers,
David.
Mug Funky
22nd February 2005, 14:34
hmmm. i believe they fail on subtitles.
not even the $100k+ standards converters work perfectly, and the smart ones fall back on field-blending when they can't get good vectors.
ronnylov
22nd February 2005, 15:13
I have a digital still camera that also can make "movies" at 320x240 resolution and 15 fps mjpeg.
I want to convert them to PAL DVD. My idea is to triple frame rate to 45 fps (either by triple each frame or by interpolation) and then duplicate every 9th frame, assume 50 fps framerate and at the end convert to 25 fps interlaced PAL, 320x576 resolution.
My original idea was this:
frames at 15 fps: 1,2,3,4,5,6,7,8,9...
frames at 45 fps: 1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,8,8,8...
frames at 50 fps: 1,1,1,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,6,6,7,7,7...
fields at 25 fps interlaced TFF:
1,1,2,3,3,4,4,5,6,6,7,7
1,2,2,3,3,4,5,5,6,6,7,8
Or is it better to convert 15 fps directly to 25 fps with interpolation and make 320x288 progressive mpeg-1 DVD?
Any ideas how to convert 15 fps to 25 or 50 fps with avisynth?
I have tried conversion from 15 fps to 25 fps with motionperfect but it resulted in ugly artifacts. I want smooth video without artifacts. I don't think duplicating every 9nth frame will be visible but it does not feel good to do it...
scharfis_brain
22nd February 2005, 21:35
get mvtools 0.9.6.2
import this function:
function mvfps(clip i, float fps, int "oversample", int "blurradius")
{
oversample=default(oversample,1)
blurradius=default(blurradius,1)
j=i.temporalsoften(2,4,5,2)
fwd=mvtools0962_mvanalyse(j,isb=false,lambda=4000)
bwd=mvtools0962_mvanalyse(j,isb=true, lambda=4000)
i.mvtools0962_mvconvertfps(bwd,fwd,fps=fps*oversample)
(oversample>1) ? last.temporalsoften(blurradius,255,255,mode=2).selectevery(oversample,0) : last
}
fps -> desired framerate
oversample -> internally calculate oversample*fps frames persecond
blurradius -> blur over (blurradius*2+1) frames of internally rendered frames per second
example:
avisource("15fps.avi")
mvfps(50,10,4)
-> internally renders 500fps (50 * 10)
-> blurs internally over 9 frames (4*2+1)
-> converts to 50fps.
the blurring is very useful to get rid (hide/reduce) of some weird mv-artifacts.
however, blurring is slooooooooooooooow.
the default
mvfps(50)
will do NO blurring, is the fastest but shows the most artifacting.
btw. mvfps() may be abused as motionblurrer
simply use:
mvfps(framerate(),10,4)
the higher the oversample, the more precise the motionblur
the higher the blurradius, the longer the motionblur gets.
Revgen
28th September 2005, 03:17
Sorry to revive an old thread, but I tried your mvfps function above on a 15fps source while trying to convert it to 60fps.
It gave me incredibly annoying motion blocks artifacts that the blur radius couldn't hide.
Fortunately I took a queue from colemar and changed the block size to 4 using the sy and sx parameters and the artifacts now no longer appear.
The video now looks great.
EG:
function mvfps(clip i, float fps, int "oversample", int "blurradius")
{
oversample=default(oversample,1)
blurradius=default(blurradius,1)
j=i.temporalsoften(2,4,5,2)
fwd=mvtools0962_mvanalyse(j,isb=false,sx=4,sy=4,lambda=4000)
bwd=mvtools0962_mvanalyse(j,isb=true,sx=4,sy=4,lambda=4000)
i.mvtools0962_mvconvertfps(bwd,fwd,fps=fps*oversample)
(oversample>1) ? last.temporalsoften(blurradius,255,255,mode=2).selectevery(oversample,0) : last
}
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.