Log in

View Full Version : Does someone know why this script is so slow?


Bh4i
24th September 2006, 12:27
I just began with some basic avisynth scripts. I think this is my 2nd script made :rolleyes:

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\HDRagc\AGC.dll")

DGDecode_mpeg2source("D:\VIDEO_TS\VTS_03_1.d2v",info=3)
ColorMatrix(hints=true)
edeintted = AssumeTFF().SeparateFields().SelectEven().EEDI2(field=-1)
tdeintted = TDeint(edeint=edeintted,order=1)
tfm(clip2=tdeintted).tdecimate(hybrid=3)
crop( 0, 72, -2, -78)
LanczosResize(640,320) # Lanczos (Sharp)
HDRAGC()
UnDot()

Im using it with MeGUI and encoding to AVC with HQ-Slow.

With all my previous encodes i encoded using ONLY MeGUI. I changed nothing with the script made with MeGUI. I did ~15-20 encodes with a average speed of ~50 fps for 1st pass en ~30 fps for 2nd pass. My CPU usages was 100%.

Now my speed for the 1st pass is only 18 fps, and my CPU usage is ~65%. Can someone tell me why this is so slow and why it doesnt use 100% CPU?

PC specs:
Intel Core2Duo E6600 @ 2,4 Ghz
2 GB RAM
WinXP SP2 Pro

-edit-
Im using 2 threads and always used 2 threads...

Guest
24th September 2006, 13:02
Why are you deinterlacing first and then applying IVTC? That doesn't make any sense to me.

Bh4i
24th September 2006, 13:08
Actually the script is made by MeGUI. I only added the HDRAGC() plugin..

When i clicked on detect source, MeGUI automatically made this script...

Guest
24th September 2006, 13:26
I suggest that you post that in the MEGUI support thread.

Bh4i
24th September 2006, 13:29
Ill do.

But im a quit newbie, but whats wrong in deinterlacing first then applying IVTC :o

Does that slowdown the encoding?

Guest
24th September 2006, 13:42
Deinterlacing destroys information needed to perform a proper IVTC.

Yes, doing both unnecessarily will slow down processing, especially the EEDI2 deinterlacing.

Bh4i
24th September 2006, 14:17
http://maxupload.com/img/839AC711

These are the options i can choose from. But when i choos some other deinterlacing method, i can see that the Avisynth script does NOT change...

Now, im not a expert in deinterlacing, but when i disable one of the lines by placing '#' before it in AvsP, i still see some interlacing.. i.e.: it seems that this is the best script, and disabling one of the lines would make it worser.

Didée
24th September 2006, 14:52
Why are you deinterlacing first and then applying IVTC? That doesn't make any sense to me.
That's not what is happening, the script seems correct. Only IVTC is applied, it's just that an "external" EEDI2 interpolation is calculated, that will be used by TFM instead of its internal ones.

The CPU usage probably drops because of the computationally expensive filtering. The script therefore delivers frames so slow that the encoder has to "wait" for avisynth to deliver new frames, so that the encoder will not use maximum possible CPU time. It just doesn't get the food fast enough.

Guest
24th September 2006, 15:06
I'm only casually acquainted with the tritical tools, so I defer to your greater knowledge of them.

Bh4i
24th September 2006, 15:40
About deinterlacing. The best deinterlace for this source is defenitely TDeint().

I tried different deinterlace and this one is many times better than others: http://forum.doom9.org/showthread.php?p=879453#post879453