PDA

View Full Version : nop() not working correct ? Or am I stupid ?


Darksoul71
29th August 2007, 22:10
Hi all,

I want to control the usage of certain denoise & sharpen scripts (imported as template) via simple AVISynth variables. Here is some simple example_
AVISource("C:\My Video.AVS")
UseSharpen=1
UseSharpen==1 ? Sharpen(1) : nop()

Idea behind this:
If UseSharpen is set to 1 (from my frontend) the sharpener shall be used. If UseSharpen is set to 0 the sharpener shall be omitted.

My problem:
As long as I leave UseSharpen set to 1 everything works fine but as soon as I set it to 0 VitualDub shows me an error which says "The result of the script is not a video clip".

What am I doing wrong here ?

Oh yes, I should add: I´m using AVISynth 2.5.7

TIA,
D$

mitsubishi
29th August 2007, 22:29
nop() returns NULL, try

UseSharpen==1 ? Sharpen(1) : last

Darksoul71
29th August 2007, 22:54
@mitsubishi:
:thanks:
Works perfectly now ! :)

Best regards,
D$

mgh
30th August 2007, 16:58
:confused:
I think plain NOP without brackets should work correctly.
I have been using the following for ages without problems in a template file for dgindex
a=="ac3" ?audiodub(last,nicac3source(aud,2)).delayaudio(e):NOP
a=="mpa" ?audiodub(last,mpasource(aud)).delayaudio(e):NOP

The a and e values are parsed from the name of the audio file demuxed by dginddex and defined as aud earlier in the script.

Darksoul71
30th August 2007, 20:37
Hi mgh,

no, NOP doesn´t work either:
UseSharpen==1 ? Sharpen(1) : NOP
This code give the same error. Do not ask me. Last works fine. So I´m happy :)

foxyshadis
30th August 2007, 21:32
nop means "no value" or null. In Darksoul's case the conditional is used to directly return a clip, whereas in the example it's used to assign a variable through something like a multiple case switch statement. Thus the difference.