View Full Version : DeInterlace : Blend for AVISynth
Blight
10th August 2002, 17:33
Is it just me, or there simply isn't a very simple, very fast deinterlacer for AVISynth? VirtualDub has it's deinterlace:blend, I think doing something similar for AVISynth should be trivial. Am I missing something?
dividee
10th August 2002, 17:43
Yep. It's called BlendFields and is in mpeg2dec.dll
Blight
11th August 2002, 05:47
Perhaps this should be moved into avisynth itself as were some of the other filters?
dividee
11th August 2002, 07:49
Indeed, I think this one is eligible for inclusion in avisynth. For a long time I thought that would cause a problem because of the name conflict with the filter in mpeg2dec.dll, and as this dll is very widespread I kept postponing. But I discovered just recently that the name conflit wouldn't be an issue. So, it will soon be migrated to avisynth (as well as SelectRangeEvery, probably).
Blight
11th August 2002, 10:19
You can always use a slightly different name for the function to assure it won't conflict.
wotef
11th August 2002, 18:22
on the subject of porting native virtualdub deinterlace modes, is there an equivalent for "deinterlace: fold side-by-side fields together"?
or is there already a method in avisynth to put fields back together that had previously been "stacked horizontal"?
dividee
11th August 2002, 20:38
This script should do it (untested):
AVISource("stackedfields.avi")
left = Crop(0,0,width/2,height)
right = Crop(width/2, 0, width/2, height)
Interleave(left,right)
AssumeFieldBased
Weave
If the field order is wrong, add ComplementParity between AssumeFieldBased and Weave.
As an exercise, try to come up with a script that does the inverse operation: stack fields horizontally :D
Richard Berg
11th August 2002, 20:57
I assume using StackHorizontal & StackVertical would be cheating?
dividee
11th August 2002, 21:46
No, it's not cheating; I think it's the best way to do it.
I never said it was difficult. This is a beginner level exercice, not for you Richard ;)
wotef
11th August 2002, 21:53
hey. dividee, don't quite understand the cropping commands [didn't know width/2 syntax was allowed], but your "unstack" works!
p.s. i knew about stackhorizontal, that's how i got into the mess that needed an "unstack"
WarpEnterprises
11th August 2002, 22:00
left = Crop(0,0,width/2,height)
equals:
left = Crop(0,0, width(last)/2, height(last))
width and height are functions in avisynth which return a value, not a clip and take a clip as input, the default clip is "last".
dividee
11th August 2002, 22:03
width & height are clip properties (among a few other). See here (http://www.avisynth.org/index.php?page=ClipProperties) for a list. With the syntax I used, they refer to the last unnamed filter output, here the output of AVISource.
These properties comes in handy when you try to write reusable script (functions), that should work with any source.
[edit] WarpEnterprises was faster than me
wotef
11th August 2002, 22:11
ah, very interesting, thanks for the link and explanations
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.