Schlumpf
29th December 2004, 02:32
Hello, people.
I got the following script in Avisynth:
### should be changed, depending on the source ###
global howmuchiwant=50
global minimumdistance=24
global sensitivity=45
### should not be changed ###
global thresh=0
global number=0
Source = AVISource("C:\path\filename").Killaudio().ConvertToYV12(interlaced=false)
Main=Source.AssumeFPS(Source.framerate*8).ReduceBy2().ReduceBy2()
Clip1=Source.AssumeFPS(Source.framerate*8).Killaudio().ConvertToRGB24(interlaced=false).ImageWriter("c:\path\filename", 0, 0, "PNG").ConvertToYV12(interlaced=false).ReduceBy2().ReduceBy2().ReduceBy2().ReduceBy2()
Minimum=BlankClip(Main).ReduceBy2().ReduceBy2()
ConditionalFilter(Main,Clip1.Trim(1,0).FrameEvaluate("thresh = current_frame").FrameEvaluate("number= number+1"),Minimum,"(YDifferenceFromPrevious > sensitivity) && (thresh+minimumdistance <= current_frame) && (number < howmuchiwant)" , "equals","true", show=false)
This script is for taking a set amount of screenshots from scenechanges in a videofile, and only that amount.
The problem is how to stop processing of the whole videostream once the variable number has reached the amount of the variable howmuchiwant. In its current state the script will just keep on playing, thus wasting processsortime.
How could I make Avisynth throw a quasi-EOF?
Another thing: Virtual Dub can scan for Keyframes in a given videostream. Is there some way to do that with Avisynth? Then I could lay the suboptimal YDifferenceFromPrevious aside.
I got the following script in Avisynth:
### should be changed, depending on the source ###
global howmuchiwant=50
global minimumdistance=24
global sensitivity=45
### should not be changed ###
global thresh=0
global number=0
Source = AVISource("C:\path\filename").Killaudio().ConvertToYV12(interlaced=false)
Main=Source.AssumeFPS(Source.framerate*8).ReduceBy2().ReduceBy2()
Clip1=Source.AssumeFPS(Source.framerate*8).Killaudio().ConvertToRGB24(interlaced=false).ImageWriter("c:\path\filename", 0, 0, "PNG").ConvertToYV12(interlaced=false).ReduceBy2().ReduceBy2().ReduceBy2().ReduceBy2()
Minimum=BlankClip(Main).ReduceBy2().ReduceBy2()
ConditionalFilter(Main,Clip1.Trim(1,0).FrameEvaluate("thresh = current_frame").FrameEvaluate("number= number+1"),Minimum,"(YDifferenceFromPrevious > sensitivity) && (thresh+minimumdistance <= current_frame) && (number < howmuchiwant)" , "equals","true", show=false)
This script is for taking a set amount of screenshots from scenechanges in a videofile, and only that amount.
The problem is how to stop processing of the whole videostream once the variable number has reached the amount of the variable howmuchiwant. In its current state the script will just keep on playing, thus wasting processsortime.
How could I make Avisynth throw a quasi-EOF?
Another thing: Virtual Dub can scan for Keyframes in a given videostream. Is there some way to do that with Avisynth? Then I could lay the suboptimal YDifferenceFromPrevious aside.