Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th January 2006, 17:16   #201  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,543
Use SetMTmode when you resize. Not the older MT filter.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.
Revgen is offline   Reply With Quote
Old 9th January 2006, 06:04   #202  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,543
Good News!: Xvid 1.1 Results

When I heard that Xvid 1.1 had been officially released as a stable build I decided to try to see if it would work at all with MT. I was surpised to see that it actually worked this time. The results are way better than with previous builds. Which is interesting because previous 1.1 betas had issues with the MT filters (at least for me). I guess the Xvid devs fixed it.

I used these filters:

FFT3DFilter v. 1.85
DGDecode v. 1.46 beta 2

Script for normal processing:

mpeg2source("E:\3s-Goofs and Saddles\goofs.d2v",idct=6)
Trim(4482,5454)
Greyscale()
fft3dfilter(sigma=5,beta=1,plane=4,bw=48,bh=48,bt=4,ow=4,oh=4,kratio=2,degrid=1.0)


Script for MT.dll :

mpeg2source("E:\3s-Goofs and Saddles\goofs.d2v",idct=6)
Trim(4482,5454)
Greyscale()
MT("fft3dfilter(sigma=5,beta=1,plane=4,bw=48,bh=48,bt=4,ow=4,oh=4,kratio=2,degrid=1.0)",2,0,false,true)


Script for SetMTmode:

SetMTmode(2)
mpeg2source("E:\3s-Goofs and Saddles\goofs.d2v",idct=6)
Trim(4482,5454)
Greyscale()
fft3dfilter(sigma=5,beta=1,plane=4,bw=48,bh=48,bt=4,ow=4,oh=4,kratio=2,degrid=1.0)



Xvid 1.1 Stable Build Results:

MT OFF - W/FFT3DFilter - 8.18 FPS
MT.dll ON - W/FFT3DFilter - 9.54 FPS - About a 16.6% increase.
SetMTmode ON - W/FFT3DFilter - 11.72 FPS - About a 25.2% increase.

EDIT:

I also tried Koepi's experimental build with Syskin's MultiThread patch, but it didn't improve performance at all because FFT3DFilter put a barrier on it's potential. However I did do a no filter test using this source in this thread.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.

Last edited by Revgen; 9th January 2006 at 17:45.
Revgen is offline   Reply With Quote
Old 10th January 2006, 02:22   #203  |  Link
psme
Registered User
 
Join Date: Mar 2005
Posts: 68
From the posts here, it seems the function SetMTMode is a internal function of Avisynth 2.56. So I downloaded the 2.5.6a from http://sourceforge.net/project/showf...group_id=57023

But it still complain "no such function SetMTMode" with this script:

SetMTMode(2)
BicubicResize(720,480)

Thanks in advance.

regards,

Li On
psme is offline   Reply With Quote
Old 10th January 2006, 02:24   #204  |  Link
tsp
Registered User
 
tsp's Avatar
 
Join Date: Aug 2004
Location: Denmark
Posts: 807
well it's an internal function of my modified avisynth 2.5.6 that you can get from my homepage(link below). It should be included in the ordinary avisynth version 2.6 when it is released.
__________________
Get my avisynth filters @ http://www.avisynth.org/tsp/
tsp is offline   Reply With Quote
Old 10th January 2006, 02:36   #205  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,543
Quote:
Originally Posted by tsp
well it's an internal function of my modified avisynth 2.5.6 that you can get from my homepage(link below). It should be included in the ordinary avisynth version 2.6 when it is released.
Perhaps you could edit your first post in the thread and add the link. That way people will know.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.
Revgen is offline   Reply With Quote
Old 11th January 2006, 01:23   #206  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
@Revgen
I'd really like to solve the two problems with EEDI2 (requiring isse processor and the problem with setmtmode(2)); however, I don't have access to a non-isse capable comp and I don't have access to a dual-processor or dual-core system so it is tough to reproduce the problems. I ran the script you posted with tsp's version of avisynth and setmtmode(2,2) on my laptop with no problems. I am pretty sure the isse problem has to be in my planarframe class since it has the only assembly stuff in EEDI2, but I can't find anything wrong in it. As for the mt problems I'm also at a loss. Could you try the following script and see if it crashes:

SetMTmode(2)
mpeg2source("mydrive:\myfolder\my.d2v")
EEDI2(field=1)

I'll make a debug build with some output strings tonight which should help pinpoint where the problem is.
tritical is offline   Reply With Quote
Old 11th January 2006, 03:55   #207  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,543
The script you gave above works fine for some material, and not for others. It's seems to be the same old story.


I've been testing for a few days now and it seems that it sometimes crashes and sometimes doesn't crash and I can't figure out why.

For example with some sources (.d2v, .avi, etc) using:

interp = separatefields().selecteven().EEDI2(field=1)
deinted = tdeint(edeint=interp,order=1,field=1)
tfm(order=1,mode=1,clip2=deinted)

will crash when it's used.


With some others it won't, but right after I add:

Tdecimate(mode=1)

so I can turn it into a 23.976 file, then it crashes.

Some scripts don't crash at all.

Sometimes changing SetMTmode to 4 or 3 will work and sometimes it won't.

I just can't figure it out. It doesn't seem to matter whether I use the test version or not.


I hope the debug build can help point to the problem. Thanks.



PS- It's TSP that has the iSSE issue.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.

Last edited by Revgen; 11th January 2006 at 04:26.
Revgen is offline   Reply With Quote
Old 11th January 2006, 04:21   #208  |  Link
tsp
Registered User
 
tsp's Avatar
 
Join Date: Aug 2004
Location: Denmark
Posts: 807
tritical: I will try and test it on my dual processor non-iSSE machine(I think I will just compile the source code and see where it breaks).
__________________
Get my avisynth filters @ http://www.avisynth.org/tsp/
tsp is offline   Reply With Quote
Old 11th January 2006, 17:34   #209  |  Link
tsp
Registered User
 
tsp's Avatar
 
Join Date: Aug 2004
Location: Denmark
Posts: 807
good news.
first both tivtc,tdeint and eedi2 works fine on my non-isse celeron processor. Must have been undot that confused me(sorry for that),
next I discovered one of the causes that lead to the crach with SetMTMode.
In the function PVideoFrame __stdcall TFMPP::GetFrame(int n, IScriptEnvironment *env)
the destination frame is sometimes just assigned from child2->GetFrame. This causes an acces error when calling dst->GetWritePointer in PutHint because env->MakeWritable is not called before. And because TDecimate has its own cache(that is usually cleared on a single processor machine before TFMPP::GetFrame is called) that contains the destination frame the crach occours. A simple solution is to add
this to end of the function TFMPP::GetFrame
Code:
	if (display) writeDisplay(dst, np, n, fieldSrc);
	env->MakeWritable(&dst);
	putHint(dst, fieldSrc, hint);
	return dst;
}
tritical how much of a problem is it that each instance of TDecimate only process every other frame with SetMTMode(2)?

TIVTC v1.0 Beta 7 for Avisynth 2.5.x with the above change(only thing different) is available here
__________________
Get my avisynth filters @ http://www.avisynth.org/tsp/
tsp is offline   Reply With Quote
Old 11th January 2006, 18:20   #210  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,543
This new TIVTC.dll build solves the Tdecimate problem for me. Thanks.

Now the other problems I have are with a Huffyuv capture clip. Whenever I use SetMTmode(2) with it and try the:

AssumeTFF()
EEDI2(field=1)

It crashes. Changing SetMTmode to 3, or 4 fixes the problem. But this script doesn't pose problems for other sources at SetMTmode(2).

I'll eventually find time to cut it and post it to Tritical's FTP site.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.
Revgen is offline   Reply With Quote
Old 11th January 2006, 21:01   #211  |  Link
J-Wo
Registered User
 
Join Date: Jan 2003
Posts: 215
Hey guys, just stumbled on this thread and it sounds very interesting! Has anyone tried DeGrainMedian with this filter? I started using it with my DVD-RB encodes with the parameters DeGrainMedian(limitY=5,limitUV=5,mode=3). According to the docs this is for "Subtle filtering but useful for hot pixels removal". I find it helps to grain compression without much blurring. The first page mentioned MT 0.41 wouldn't work with dust, so I wasn't sure if this denoiser would work either. Another thread here mentioned using fft3dfilter instead of pixiedust... How do you guys find these compare? Any recommended settings/parameters for use with MT? Thanks in advance!
J-Wo is offline   Reply With Quote
Old 12th January 2006, 00:25   #212  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
Thanks for finding that bug tsp. I'll add that fix in the next release.

Processing every other frame would only cause problems for modes 3 and 7 of tdecimate. All other modes should be fine and produce the same output. However, I'm not sure it would make things much faster for modes 0 and 1 since both instances would be doing calculations for all frames. Modes 0/1 work by calculating everything for the entire cycle the first time a frame from a new cycle is requested. During that initial processing it is decided which frame(s) will be dropped and which will be kept and from then on the only processing done for requests for frames in that cycle is just a LUT lookup.
tritical is offline   Reply With Quote
Old 12th January 2006, 02:23   #213  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,543
@Tritical

I posted the clip on your FTP server. It's EEDI2_TestClip.avi.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.
Revgen is offline   Reply With Quote
Old 12th January 2006, 05:39   #214  |  Link
J-Wo
Registered User
 
Join Date: Jan 2003
Posts: 215
okay guys, been giving these filters a try and had some comments/questions.

To start off, I found it a bit confusing from the first post that there are in fact two different versions of this filter, the older mt.dll and the newer setmtmode. I was also confused that the updated avisynth.dll was in the third attachement and was not the same as the one included with mt.dll. Perhaps you could split your first post off and date the two sections so they appear a bit more seperate?

My confusion actually led me to the discovery that the combination of mt("filter",2,0) + SetMTMode() lead to a faster encode time for my test than either two alone. I'm not sure if I was doing things right, but this is the script I tried:

Code:
LoadPlugin("D:\Program Files\DVD-RB PRO\DGDecode.dll")
mpeg2source("F:\BABYLON5_SEASON2_DISC1\D2VAVS\V01.D2V",idct=6)
trim(5,7384)
Crop(16,16,-16,-16)
SetMTMode(1)
MT("DeGrainMedian(limitY=5,limitUV=5,mode=3)",2,2)
AddBorders(16,16,16,16)
ConvertToYUY2(interlaced=true)
This is a 5 min clip used for DVD-RB Pro. My system is an Opteron 165 @ 2.6GHz and I'm using CCE 2.70.02. Strange thing is my CPU utilization never goes beyond 79%. Amy I doing something wrong? Any suggestions for the script I used? Thanks!
J-Wo is offline   Reply With Quote
Old 12th January 2006, 06:10   #215  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,543
The Task Manager is never accurate when reporting CPU usage. Always measure performance when using different filters.

Using SetMTmode and MT.dll can sometimes result in faster performance sometimes not. Some filters work better exclusively with MT.dll or SetMTmode.

You just have to experiement.

SetMTmode(1) is the fastest that you can use. But it's not that much faster than SetMTmode(2). Often it doesn't work for most scripts I use. For most scripts and filters, SetMTmode(2) tends to work best.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.
Revgen is offline   Reply With Quote
Old 12th January 2006, 06:34   #216  |  Link
J-Wo
Registered User
 
Join Date: Jan 2003
Posts: 215
Thanks Revegen. I did some more testing after that post and found a large speed increase by putting SetMTMode(2) and the top of my script before mpeg2source, without using the old MT() filter. Bit of an annoyance with DVD-RB as a previous poster mentioned, as I'll have to use a 3rd party program Rb-Opt to manually insert the line. For some reason SetMTMode(1) crashes when I put it at the top of my script... I'll have to play around with this a bit more
J-Wo is offline   Reply With Quote
Old 12th January 2006, 06:43   #217  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,543
Quote:
Originally Posted by J-Wo
Thanks Revegen. I did some more testing after that post and found a large speed increase by putting SetMTMode(2) and the top of my script before mpeg2source, without using the old MT() filter. Bit of an annoyance with DVD-RB as a previous poster mentioned, as I'll have to use a 3rd party program Rb-Opt to manually insert the line. For some reason SetMTMode(1) crashes when I put it at the top of my script... I'll have to play around with this a bit more
I usually put SetMTmode at the top of my script, since the performance is more steady. When it's not at the top, sometimes the performance can fluctuate throughout the encode.

SetMTmode in general is faster and more compatible with most scripts. However the old MT.dll filter works faster with some filters like FFT3Dfilter.
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.
Revgen is offline   Reply With Quote
Old 12th January 2006, 15:28   #218  |  Link
J-Wo
Registered User
 
Join Date: Jan 2003
Posts: 215
Hmmm I just put SetMTMode(2) at the top of my DVD-RB scripts, but some reason when CCE was encoding the third segment (RB splits the movie up into cells for encoding) the encoder froze. Under Task Manager the CCE process was stuck at 50% CPU utilization but it wasn't doing any encoding, normally it's in the 80's. But all my AVS scripts are viewable under Vdub-Mpeg2 and media player classic. I switched the line to SetMTMode(5) and so far so good. I don't know what's causing the problem!
J-Wo is offline   Reply With Quote
Old 12th January 2006, 17:24   #219  |  Link
tsp
Registered User
 
tsp's Avatar
 
Join Date: Aug 2004
Location: Denmark
Posts: 807
the first SetMTMode line must appear before the first filter that returns a clip(video) for SetMTMode to be enabled also use SetMTMode(5) with MT because MT does its own multithreading. I know the documentation sucks and I think I will release a new version of MT.dll that includes the newest version of my modified avisynth.dll(and in fact will requere it). That might reduce the confusion.
Could you try this version of your script:
Code:
LoadPlugin("D:\Program Files\DVD-RB PRO\DGDecode.dll")
SetMTMode(2)#or 5 if you still get lockups
mpeg2source("F:\BABYLON5_SEASON2_DISC1\D2VAVS\V01.D2V",idct=6)
trim(5,7384)
Crop(16,16,-16,-16)
SetMTMode(5)
MT("DeGrainMedian(limitY=5,limitUV=5,mode=3)",2,2)
SetMTMode(2)
AddBorders(16,16,16,16)
ConvertToYUY2(interlaced=true)
__________________
Get my avisynth filters @ http://www.avisynth.org/tsp/
tsp is offline   Reply With Quote
Old 13th January 2006, 05:55   #220  |  Link
J-Wo
Registered User
 
Join Date: Jan 2003
Posts: 215
does it make a difference if I have my setmtmode line as the very first line in the script, or does it have to be directly preceeding the mpeg2source line?

I'm getting some even more lockups using this script now. mode2 is still causing cce to hang, but so is mode1 and now mode4. One time while testing ALL the modes caused vdub or cce to lock up, and I had to reboot. Really really strange...
J-Wo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 17:57.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.