Log in

View Full Version : ConditionalFilter


TheLastOfUs
1st August 2018, 13:40
Hi all,

How does one use the Conditional filter? Did a read up and kind of lost. I see scripts using it as a debanding sort of thing - but unclear as to how the SceneTypes.txt is generated exactly? Also unsure of the "R # # 1/2/3" in that file.

Can anyone please explain?

StainlessS
1st August 2018, 14:56
Your question dont seem to make much sense, what SceneTypes.txt ???

ConditionalFilter(clip testclip, clip source1, clip source2, string expression1, string operator, string expression2 [, bool show] )

Anyways, you could do an Advanced Search (at top of every D9 page) limiting to Avisynth Usage forum.

Maybe you mean ConditionalReader:- http://avisynth.nl/index.php/ConditionalReader

TheLastOfUs
2nd August 2018, 01:04
Conditional Filter and Reader yes both. I'm seeing scripts of text files with conditional reader. That link you sent was super helpful. I get it now.

Shinkiro
29th January 2021, 12:54
can someone explain why this script works?

C1=DGSource("VTS_01_2.dgi").TFM(mode=4,pp=5,MI=1,display=false, slow=1,cthresh=9,mthresh=5,chroma=false,ubsco=false,hint=true,opt=4,metric=0)
LWLibavVideoSource(lossless - 02.mkv").Spline36Resize(720, 480)
C2=last
ConditionalFilter(C1, C2, "MyVar", "==", "False", false)
ConditionalReader("Frame-list2.txt", "MyVar", false)

and this one works

C1=DGSource("VTS_01_2.dgi").TFM(mode=4,pp=5,MI=1,display=false, slow=1,cthresh=9,mthresh=5,chroma=false,ubsco=false,hint=true,opt=4,metric=0)
C2=LWLibavVideoSource(lossless - 02.mkv").Spline36Resize(720, 480)
С2
ConditionalFilter(C1, C2, "MyVar", "==", "False", false)
ConditionalReader("Frame-list2.txt", "MyVar", false)


but this one does not work?

C1=DGSource("VTS_01_2.dgi").TFM(mode=4,pp=5,MI=1,display=false, slow=1,cthresh=9,mthresh=5,chroma=false,ubsco=false,hint=true,opt=4,metric=0)
C2=LWLibavVideoSource("lossless - 02.mkv").Spline36Resize(720, 480)
ConditionalFilter(C1, C2, "MyVar", "==", "False", false)
ConditionalReader("Frame-list2.txt", "MyVar", false)

http://i114.fastpic.ru/big/2021/0129/e4/89dfa2d3ead90fecd10128e5ceb51de4.png

poisondeathray
29th January 2021, 19:53
can someone explain why this script works?

C1=DGSource("VTS_01_2.dgi").TFM(mode=4,pp=5,MI=1,display=false, slow=1,cthresh=9,mthresh=5,chroma=false,ubsco=false,hint=true,opt=4,metric=0)
LWLibavVideoSource(lossless - 02.mkv").Spline36Resize(720, 480)
C2=last
ConditionalFilter(C1, C2, "MyVar", "==", "False", false)
ConditionalReader("Frame-list2.txt", "MyVar", false)

and this one works

C1=DGSource("VTS_01_2.dgi").TFM(mode=4,pp=5,MI=1,display=false, slow=1,cthresh=9,mthresh=5,chroma=false,ubsco=false,hint=true,opt=4,metric=0)
C2=LWLibavVideoSource(lossless - 02.mkv").Spline36Resize(720, 480)
С2
ConditionalFilter(C1, C2, "MyVar", "==", "False", false)
ConditionalReader("Frame-list2.txt", "MyVar", false)


but this one does not work?

C1=DGSource("VTS_01_2.dgi").TFM(mode=4,pp=5,MI=1,display=false, slow=1,cthresh=9,mthresh=5,chroma=false,ubsco=false,hint=true,opt=4,metric=0)
C2=LWLibavVideoSource("lossless - 02.mkv").Spline36Resize(720, 480)
ConditionalFilter(C1, C2, "MyVar", "==", "False", false)
ConditionalReader("Frame-list2.txt", "MyVar", false)

http://i114.fastpic.ru/big/2021/0129/e4/89dfa2d3ead90fecd10128e5ceb51de4.png


There is no implied "last" in the last one

Gavino
29th January 2021, 20:43
That's right, pdr.

ConditionalFilter takes three clip arguments, so when only two are supplied, last will be implicitly used as the first clip.

Shinkiro
29th January 2021, 20:49
There is no implied "last" in the last one
Ok you're right, this is how it works without errors

C1=DGSource("VTS_01_2.dgi").TFM(mode=4,pp=5,MI=1,display=false, slow=1,cthresh=9,mthresh=5,chroma=false,ubsco=false,hint=true,opt=4,metric=0)
C2=LWLibavVideoSource("lossless - 02.mkv").Spline36Resize(720, 480)
ConditionalFilter(С2,C1,C2, "MyVar", "==", "False", false)
ConditionalReader("Frame-list2.txt", "MyVar", false)

In my case, source1 is the main clip, source2 takes frames to be replaced and then the output is a mix. As far as I understand, it doesn't matter for me which clip I put there, it will not affect the result?

Gavino
29th January 2021, 23:12
As far as I understand, it doesn't matter for me which clip I put there, it will not affect the result?
Correct.
Since in your case, the conditional expression ("MyVar == False") does not depend on the first clip (the so-called 'test clip').

Shinkiro
30th January 2021, 00:06
Gavino
I see, thank you for your help!