View Full Version : Is it possible to use SmoothDeinterlacer with DGDecode or mpeg2dec3?


zeus163
25th May 2004, 06:29
I use Xesdeeni's excellent PAL to NTSC standards conversion script:
LoadPlugin("C:\SmoothDeinterlacer.dll")
LoadPlugin("C:\MPEG2DEC.dll")
MPEG2Source("C:\ff matinee 4-18.d2v")
SmoothDeinterlace(doublerate=true)
LanczosResize(720,480)
ChangeFPS(59.94)
SeparateFields()
SelectEvery(4,1,2)
Weave()
ConvertToRGB()

However, I can only seem to get it to work with mpeg2dec. I'd like to use newer versions of mpeg2dec with my encodes as I believe they are faster and I don't want to drop any frames when I create the d2v file. I just can't seem to get it to work. I just tried to run it by using an oldplugins.avsi file, but that didn't work either. Of course, it wouldn't surprise me if I had made some error on that.

I looked to see if there were any updates to smoothdeinterlacer, but didn't see any. I know it works with Avisynth 2.5+, but just wondering if there is a possibility of making it work with the newer versions.

Any help would be appreciated. Thanks!

Bogalvator
25th May 2004, 08:03
Unfortunately, SmoothDeinterlace only works on YUY2 sources, and the newer MPEG2DEC3/DGMPGDec decode MPEG2 sources in there native YV12 colourspace.

Hence, you need to add the line

converttoyuy2(interlaced=true)

before using SmoothDeinterlace.

zeus163
25th May 2004, 09:09
Thank you very much! Worked like a charm!

scharfis_brain
25th May 2004, 10:12
try kernelbob() instead of smoothdeinterlacer.

It will give you much better deinterlacing quality

zeus163
25th May 2004, 10:14
Really? Even though I try to keep up, I've stayed with what has worked for me.

Would a plain kernelbob()replace the SmoothDeinterlace(doublerate=true)line? I just want to make sure.

Of course, I could try this tomorrow as I've stayed up much too late as it is! Thanks!

Edit...I just looked for Kernelbob and I found some text to copy. Do I copy/paste that text into a notepad file and save it as kernelbob.dll or something? Sorry for the silly question. Most of my scripts are simply from reading here finding posts that match what I'm trying to do.

scharfis_brain
25th May 2004, 10:40
paste this code into a file called kernelbob.avs

function kernelbob(clip a, int "th",bool "mask")
{ mask=default(mask,false)
th=default(th,5)
ord = getparity(a) ? 1 : 0
f=a.kerneldeint(order=ord, sharp=true, twoway=false, threshold=th,map=mask)
e=a.separatefields.trim(1,0).weave.kerneldeint(order=1-ord, sharp=true, twoway=false, threshold=th,map=mask)
interleave(f,e).assumeframebased
}

then, your script has to be modified:

Import("kernelbob.avs")
LoadPlugin("C:\kerneldeint140.dll")
LoadPlugin("C:\MPEG2DEC.dll")
MPEG2Source("C:\ff matinee 4-18.d2v")
kernelbob()
LanczosResize(720,480)
ChangeFPS(59.94) #I would better use convertfps(59.94) here
SeparateFields()
SelectEvery(4,1,2)
Weave()
ConvertToRGB()

You're the first victim, I am saying that:

download manaos mvtools.dll and replace the changefps with mvconvertfps(59.94)
it will look moch smoother than change/convertfps.

btw.: is your video true interlaced (50 states of motion per second?)
if it is telecined film or something else, xesdeeni's conversion method will only mess up the content.

zeus163
25th May 2004, 11:05
Wow! That appears to work except the line: mvconvertfps(59.94). I finally took it out and replaced it with convertfps(59.94) and that works. I made sure the mvtools.dll was in the right place and even included a loadplugin line for it. Does mvtools work with the DGDecode? That's what I'm trying to use so that I don't drop frames when using the newest version of DVD2AVI--DGIndex.

I'm doing a test encode now that I'll test in the morning.

As far as my material goes, I don't know if my video is truly interlaced--the particular source I'm working on now is, but some of the others I don't know. However, I've always been happy with the end product when watched on the TV.

I really appreciate your help.

scharfis_brain
25th May 2004, 11:15
without char-exact error message, I am unable to give specific help

Guest
25th May 2004, 12:58
Mod note: This thread was erroneously closed.
Explanation: I had to edit out a bad word. We are supposed to copy threads to Thread Moderation before we edit. Now it seems that also automatically closes the thread.
Corrective Action: Thread re-opened and explanation given.

Please excuse the inconvenience.

zeus163
25th May 2004, 15:00
Scharfiss_brain
--I'm trying this right now:
Import("C:\kernelbob.avs")
LoadPlugin("C:\kerneldeint140.dll")
LoadPlugin("F:\DGDecode.dll")
MPEG2Source("F:\try.d2v")
ConvertToYv12(interlaced=true)
kernelbob()
LanczosResize(720,480)
mvconvertfps(fps=59.94)
SeparateFields()
SelectEvery(4,1,2)
Weave()
ConvertToRGB()

I'm not sure it's right, but it opened in virtualdub and it's encoding right now in CCE. However, my encoding time went down from an already slow 0.38 to 0.10 with this clip.

I used this one when I finally went to bed and it was cruising at about .38. I wonder why the difference.
Import("C:\kernelbob.avs")
LoadPlugin("C:\kerneldeint140.dll")
LoadPlugin("F:\DGDecode.dll")
MPEG2Source("F:\try.d2v")
converttoyuy2(interlaced=true)
kernelbob()
LanczosResize(720,480)
convertfps(59.94)
SeparateFields()
SelectEvery(4,1,2)
Weave()
ConvertToRGB()

Once again, thanks for all of your help. I'm going to test these when I get home on my DVD player, however, I fear that mvconvertfps will have to blow my mind to justify the encoding speed hit. Unless, I'm doing something wrong (again).

scharfis_brain
25th May 2004, 15:23
on the upper script, knock out converttoyv12(interlace=true) it seems to be useless and wastes CPU time.

take a short scene with a FAST pan, and then do 3 encodes.

1) changefps(59.94)
2) convertfps(59.94)
3) mvconverfps(fps=59.94)

1 makes MOST stutter
2 makes lesser stutter
3 nearly avoids all stutter

put all three encodes on CD-RW / DVD-RW and compare them on TV.
(NOT on PC)

imo mvconverfps is wirth its slow encoding speed.

btw. delete the converttorgb() line at the end of that scripts.

Chainmax
25th May 2004, 16:24
scharfis_brain, why didn't you recommend Intellibob() instead?

Slight hijack: does anyone know if DGMPGDec is safe to use in programs/avs scripts that use plain mpeg2dec3 v1.10 and DVD2AVI 1.76 (like funkydeblock, hybridfupp, YATTA)?

Guest
25th May 2004, 16:50
Originally posted by Chainmax
Slight hijack: does anyone know if DGMPGDec is safe to use in programs/avs scripts that use plain mpeg2dec3 v1.10 and DVD2AVI 1.76 (like funkydeblock, hybridfupp, YATTA)? They should be fine, unless they read the D2V file for their own purposes.

DDogg
25th May 2004, 17:00
scharfis_brain, your example of kernelbob.avs seems to be a later version of something you pointed me to earlier where I used kernelbob(7) with mvconvert60ito24p(3). Have parameters changed any? Should this be considered the latest version of your kernelbob script? If so, perhaps you should consider a numbering system as you continue to improve the scripts. As always, thanks for your work. It is very much appreciated. I suspect by more folks that you might realize, imo.

zeus163
25th May 2004, 17:14
When I get home from work I will try my script without the ConvertToYV12 line. I added that since Virtualdub errored on me saying that mcconvert needed YV12 material. I had had a ConvertToYuy line to use smoothdeinterlacer with the later versions of mpeg2dec3.

Thanks for all of your help.

scharfis_brain
25th May 2004, 19:11
chainmax:
Let's start things slowly, I cannot throw big balls to someone, who cannot catch them...

I think, intellibob() would have been too much input, thats why I decided to take kernelbob() instead.
Plus intellibob() is terribly slow compared to kernelbob() and might leave some combing left in special cases...

ddgog:
I've no version numbering...
but this kernelbob isn't really different from the other ones.
only its threshold is setted via kernelbob(th=7)