View Full Version : Deinterlacing


Pages : 1 [2]

Riley Harmon
April 13th, 2005, 12:41 PM
hey josh what are the AVSI and AVS scripts for the mvbob method you talk about? thanks

Josh Barker
April 13th, 2005, 01:55 PM
I lurk around the Doom9 forums at http://forum.doom9.org/ in the AviSynth forum. You can find MVBob() there. Here is a direct link to the page which gives you all the filters you need to get MVBob() to work:

http://forum.doom9.org/showthread.php?threadid=84725&perpage=20&highlight=mvbob&pagenumber=4#post606487

@ Jonathon Wilson: Glad you like the results! I do too :-), it is probably the best deinterlacer there is. Usually one such as this one (motion-compensated) is used in television series and anything that is being converted to the big-screen. And it usually costs MEGA $$$ and is done by hardware. We now have a nice software version (little slower, but it works wonders!).

Jonathon Wilson
April 13th, 2005, 02:13 PM
The thread is long with many different iterating versions of the script. However well into the thread, there is a link to an archive containing the finished script and all the plugins needed. You can get it at the following:

http://home.arcor.de/scharfis_brain/mvbob/mvbob.rar

At least for now. Riley, what I did was unrar this whole thing into a directory of its own (something like c:/avisynthwork/mvbob).

Then I added an include at the top of my avisynth script which just includes the mvbob script from that directory:

include("c:/avisynthwork/mvbob/mvbob.avs")

This loads up all the right versions of the plugins etc. (at least it did for me...)

Then you can just:

fixed = src.mvbob()

easy peasy.

Rokta Bija
April 13th, 2005, 03:24 PM
Jonathon, are you getting 3fps at 60ito60p or 60ito30p?

I get 3fps if I leave it at 59.94p but I'm only getting 1-2fps with MVbob for 60ito30p. From 60ito24p I'm getting less than .05fps (15 sec per frame) using mv60ito24p in default mode, and .5fps in mode3. Painful !

Josh, are you using the default settings with mvbob or? Also are you using the mvfps function inside the mv60ito24p in your AVS?

Here is what I am using. See anything that would cause the slowdown?

import("C:\Program Files\AviSynth 2.5\filters\MVBOB\mvbob.avs")
import("C:\Program Files\AviSynth 2.5\filters\MVbob\mv60ito24p.avs")
AVISource("f:\test7\4months - Clip 001.avi")
assumebff()
ConvertToYV12(interlaced=true)
mvbob()
mv60ito24p(mode=3)
ConvertToRGB24()

Josh Barker
April 13th, 2005, 06:11 PM
I am using mode 2 for mv60ito24p(). I have a hefty computer (3.2 Ghz HT, 1 GB RAM) and rendering is around 1-3 fps. HT is enabled and I've heard (since AviSynth doesn't support dual processors) it may be faster when disabled (haven't tested it yet).

Script I am using:
-------------------------

LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\LoadPluginEx2.dll")
LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\warpsharp.dll")
ImportPlugin("mvbob.avs")

AVISource("G:\Final Drunk Driving 1.avi",fourCC="CDVC")
TrimTime("00:21:00:00","00:21:20:00") #trimtime function by me

FixBrokenChromaUpsampling() #fixes bug in dv codec
ReInterpolate411() #ntsc capture bug fix

AspectRatio().AddBorders(0,1,0,2) #4:3 to 16:9

AssumeTFF() #not assumebff, I added borders so it shifted to tff
converttoyv12(interlaced=true)

MVBob() #deinterlace
mv60ito24p(2) #60p to 24p

ColorYuv(levels="TV->PC") #fix colors
Levels(10,1.0,255,0,255)

LimitedSharpen(overshoot=7,strength=100) #sharpen the picture

AddBorders(0,37,0,36) #letterbox 16:9
AddAudio() #add fake audio due to dv type-I, I use

ConvertToRGB().GiCoCU("J:\link2\s-curve.amp",photoshop=true) #apply film gamma s-curve

ConvertToYUY2() #not necessary if converting to mpeg-2


-------------------

You may also increase in speed with mv60ito24p() if you use the following instead of the one you downloaded (I modified it to actually increase the speed):

-------------------

function mv60ito24p(clip x, int "mode")
{

mode = default(mode,2)
mbl=0.1
fwd=mvtools0962_mvanalyse(x,isb=false,lambda=4000)
bwd=mvtools0962_mvanalyse(x,isb=true, lambda=4000)

y=x.mvtools0962_mvinterpolate(bwd, fwd, nb = 4,bl = 0.5-mbl, el = 0.5+mbl, wf = "uniform")
interleave(y,x)
mode0=selectevery(5,2)
mode1=merge(selectevery(5,3),selectevery(5,2),opacity=0.5)
mode2=merge(merge(selectevery(5,1),selectevery(5,3),opacity=0.5),selectevery(5,2),opacity=0.3)
mode3=merge(merge(selectevery(5,0),selectevery(5,3),opacity=0.5),merge(selectevery(5,1),selectevery( 5,2),opacity=0.5),opacity=0.5)

(mode==0) ? mode0 : (mode==1) ? mode1 : (mode==2) ? mode2 : mode3

}

function merge(clip a,clip b,float "opacity"){
opacity=default(opacity,0.5)
return a.MergeLuma(b,opacity).MergeChroma(b,opacity)
}

Rokta Bija
April 15th, 2005, 06:33 PM
I tired the modified mv60ito24p and it is faster, thanks. I also put the mvbob() function inside the AVS instead of importing it and that picked up speed also.

In the Avisource line, are you forcing a different codec with the fourcc command?

I had not used the overshoot parameter in LimitedSharpen, I liked the result. When I tried some other numbers, I didn't notice much difference from 7.

What do these two lines do:

ColorYuv(levels="TV->PC") #fix colors
Levels(10,1.0,255,0,255)

Am I correct in thinking the ColorYuv(levels="TV->PC") scales a 16-235 to 0-255? And what is levels() doing?

Patrick Jenkins
April 20th, 2005, 08:53 PM
What's a good format to save the final 24P to (I'm assuming a lossless, progressive format)?

Kyle Edwards
April 20th, 2005, 10:41 PM
What's a good format to save the final 24P to (I'm assuming a lossless, progressive format)?

Encode to your final product straight from the script. If not, try HUFFYUV or Lagarith, both lossless. Or, why not DV again?

Patrick Jenkins
April 21st, 2005, 10:18 AM
Well.. DV isn't lossless so there's degeneration to worry about, but also, won't saving as DV effectively reinterlace your material - at the very least bring back fields? Also, NTSC DV is stuck w/ 29.97 (or there abouts) frame rate, so inorder to save the 23.976 you'd have to do some sort of pull down (or something) - but I'm still trying to figure this process out.

Wouldn't it be all around better to use a final file format that's progressive and lossless (I've got Huffy, I'll experiement with that)?

Kin Kwan
April 21st, 2005, 10:58 AM
HuffYUV is a good choice. It's what I use, too! (But the files are BBBIIIIIIIGGGG)

Kyle Edwards
April 21st, 2005, 12:08 PM
Well.. DV isn't lossless so there's degeneration to worry about, but also, won't saving as DV effectively reinterlace your material - at the very least bring back fields? Also, NTSC DV is stuck w/ 29.97 (or there abouts) frame rate, so inorder to save the 23.976 you'd have to do some sort of pull down (or something) - but I'm still trying to figure this process out.

Wouldn't it be all around better to use a final file format that's progressive and lossless (I've got Huffy, I'll experiement with that)?

All comes back down to, what is your final product? Are you putting the video on the web, archiving your work, or putting onto DVD? DV isn't stuck at 29.976, just 720x480. I've made plenty of 18fps and 23.976 DV files.

HUFFYUV and Lagarith (which is basically HUFFYUV but tweaked, you get much smaller file sizes) are great for archiving, but they will take up alot of room.