View Full Version : Avisynth equivalent to VDub's deinterlace?
DeathAngelBR
8th July 2007, 19:57
I use megui to create avs scripts, and so far none of the deinterlacers worked on this DVD source. Megui says it's hybrid/most interlaced with 69% video. But VDub's deinterlace filter works perfectly, so I'm wondering if there's an equivalent filter or filters combination that can be used in avisynth? Thx.
Didée
8th July 2007, 21:51
Which VirtualDub Deinterlacing filter? A certain external one?
If you're after the internal "Deinterlace - Blend fields together (best)" filter:
(where "best" is actually the most simple/dumb, however failsafe method)
Bob()
Merge( SelectEven(), SelectOdd(), 0.5 )
On video sections, this will necessarily produce blended frames, i.e. "doubled contours".
DeathAngelBR
8th July 2007, 22:46
If you're after the internal "Deinterlace - Blend fields together (best)" filter:
That's the one.
(where "best" is actually the most simple/dumb, however failsafe method)
Bob()
Merge( SelectEven(), SelectOdd(), 0.5 )
On video sections, this will necessarily produce blended frames, i.e. "doubled contours".
"Dumb", but the only one that did it "right" and didn't blur japanese kanji. The only drawbacks that remain to be fixed are the annoying horizontal lines.
pic 1 (http://img523.imageshack.us/img523/3482/pic001km9.png)
pic 2 (http://img523.imageshack.us/img523/825/pic002oq7.png)
pic 3 (http://img523.imageshack.us/img523/3084/pic003bc9.png)
pic 4 (http://img523.imageshack.us/img523/7938/pic004rx6.png)
Didée
8th July 2007, 23:13
Either you resized wrongly before deinterlacing (progressive resizing on an interlaced source) (unlikely), or the source you're starting with is already kaput (more likely).
Why are you showing 640*xxx screenshots at all. A DVD source is supposed to have 720*xxx resolution, so some resizing has happened between DVD source and your screenshots.
When discussing deinterlacing problems, the first & most forbidden thing is resizing ...
DeathAngelBR
8th July 2007, 23:52
Source resolution is 720x480. Deinterlaced it first, then cropped (6,68,4,68), THEN resized to 640x352 - though there's a 4:3 flag that makes it look horrible. Those lines appear in many scenes, very noticeable.
And yeah, it's pretty damn old, 1998 or 1999.
Another edit:
Previously I used this:
# 1st pass
# tfm(order=1,output="tfmout.txt")
# tdecimate(hybrid=3,blockx=4,blocky=4,output="tdecout.txt")
# 2nd pass
# tfm(order=1,input="tfmout.txt",ovr="tfmover2.txt")
# tdecimate(hybrid=3,blockx=4,blocky=4,input="tdecout.txt",tfmin="tfmout.txt",ovr="tfmover2.txt")
# crop, resize, undot, fluxsmoothst, tweak ...
There were lots of frame ranges marked as combed and not deinterlaced, and also frame matches in the tfmover2.txt. Even then it couldn't do much and left some interlaced frames.
TDEint (sic) and EDDI2 (sic) didn't help either, in fact these were the worst. Not SOME, but MANY frames were untouched (interlaced).
foxyshadis
9th July 2007, 00:01
Post your script and post at least 20 seconds of video that shows the artifacts somewhere. (As vob/m2v, not an avi re-encode!) Guessing based on the final result is useless, better to see the original.
DeathAngelBR
9th July 2007, 00:02
Post your script and post at least 20 seconds of video that shows the artifacts somewhere.
In a few.
DeathAngelBR
9th July 2007, 01:18
Linky: http://download.yousendit.com/A616D36B3C15886B
foxyshadis
9th July 2007, 04:27
I think you should load it into virtualdub and test its deinterlacer, if anything it only makes the bending already present in the source worse:
frame 1 (http://foxyshadis.slightlydark.com/random/vdub1.jpg), frame 2 (http://foxyshadis.slightlydark.com/random/vdub2.jpg), frame 3 (http://foxyshadis.slightlydark.com/random/vdub3.jpg) (#3 is okay in the source, here just to show why blend deint is baaaaaaad.)
(It looks like you picked a very messed up transfer as your first avisynth effort. Take this field (http://foxyshadis.slightlydark.com/random/field1.jpg) or this one (http://foxyshadis.slightlydark.com/random/field2.jpg) directly from the original, for instance.)
I played with fixblendivtc a bit, hoping I'd get okay results, but it appears the blending is too much for it. So tfm+tdec alone it is:
frame 1 (http://foxyshadis.slightlydark.com/random/tdec1.jpg), frame 2 (http://foxyshadis.slightlydark.com/random/tdec2.jpg), frame 3 (http://foxyshadis.slightlydark.com/random/tdec3.jpg)
The blending's definitely all in your source. It probably isn't reversible; as opposed to a standards conversion, in yours it's just that every field includes an echo of the three fields that come before it. Oddly, someone else just posted something with the same sort of pathological transfer.
DeathAngelBR
9th July 2007, 15:23
The blending's definitely all in your source. It probably isn't reversible; as opposed to a standards conversion, in yours it's just that every field includes an echo of the three fields that come before it. Oddly, someone else just posted something with the same sort of pathological transfer.
I suppose you're talking about this thread (http://forum.doom9.org/showthread.php?t=127660)? Okay, so I used tomsmocomp() but there are still little yet annoying artifacts (random pixels) appearing. Good thing is the horizontal lines are no longer noticeable as they were.
foxyshadis
9th July 2007, 22:40
No, this thread (http://forum.doom9.org/showthread.php?t=127437). Jagged diagonals are a completely unrelated problem. If you don't want to run the risk of jerkiness using tfm+tdecimate, use smoothdeinterlacer or yadif instead. Maybe tdeint with the thresholds at zero. That way details will be mostly interpolated (which tfm will also do) rather than trying to mix together bad blends.
DeathAngelBR
10th July 2007, 04:44
No, this thread (http://forum.doom9.org/showthread.php?t=127437). Jagged diagonals are a completely unrelated problem. If you don't want to run the risk of jerkiness using tfm+tdecimate, use smoothdeinterlacer or yadif instead. Maybe tdeint with the thresholds at zero. That way details will be mostly interpolated (which tfm will also do) rather than trying to mix together bad blends.
SD left a few artifacts here and there, while yadif did slightly better. Thanks anyway.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.