Log in

View Full Version : GaussResize/ConditionalReader problem


dahl
4th September 2005, 15:50
I have a little problem feeding the sharpness parameter of GaussResize with values from a textfile using conditionalreader. I'd be happy if any of you could help me solve this.

The script (so far):
---
movie=mpeg2source("movie.d2v")
movie=crop(movie,0,18,720,542)
movie=temporalsoften(movie,3,4,4,15,2)
movie=ConditionalReader(movie,"blurvalues.txt", "blurvar", false)
movie=GaussResize(movie,640,336,0,0,720,542,int(blurvar))

return movie
---

Snippet from blurvalues.txt:
---
Type int
Default 100
0 100
1 80
2 77
3 82
---

Wilbert
4th September 2005, 16:04
movie=mpeg2source("movie.d2v")
movie=crop(movie,0,18,720,542)
movie=temporalsoften(movie,3,4,4,15,2)
movie=ScriptClip(movie, "GaussResize(640,336,0,0,720,542,int(blurvar))")
movie=ConditionalReader(movie,"blurvalues.txt", "blurvar", false)


Something like this should work, but i didn't test it. Btw:

"Conditional filters however, need to evaluate scripts before they request frames from the filter above, because they need to know which filter to call. An other important issue is that only global defined variables in the conditional filter 'environment' can be used outside (and vice versa). Have a look at the following script"

see: http://www.avisynth.org/ConditionalFilter

dahl
4th September 2005, 16:10
Thanks for the quick reply Wilbert.

I tested the script you posted and it prints
the following errormessage onto the video:

ScriptClip: Function did not return a video clip with the same width as the source clip!

sh0dan
4th September 2005, 16:18
global condi
movie=mpeg2source("movie.d2v")
movie=crop(movie,0,18,720,542)
condi=temporalsoften(movie,3,4,4,15,2)
movie = bilinearresize(movie, 640,336,0,0,720,542)
movie=ScriptClip(movie, "GaussResize(condi, 640,336,0,0,720,542,int(blurvar))")
movie=ConditionalReader(movie,"blurvalues.txt", "blurvar", false)
return movie

dahl
4th September 2005, 16:41
Thanks sh0dan

The line "global condi" caused an error about an expected =.
Changing the line to "global condi = 0" made the script work.

Thanks a bunch for your help Wilbert & sh0dan