PDA

View Full Version : Detect Scene Changes and output to txt-file


resonator
28th February 2005, 13:40
Hi there!

As the subject says, I'm looking for a method to use an AviSynth-script to detect scene-changes (respectivly cuts) and output the framenumber to a text-file. I did search the forum but I couldn't come up with something useful yet.

Any ideas?

actionman133
3rd March 2005, 06:21
i can't give you a script to just copy and paste, but i can provide some suggestions.

first of all, you need to compare the differences between frames, so the Subtract function would be needed.

Best to be like this:

Delta = Subtract (Video, Video.Trim (1, 0))

if you switch the trim to the first video, you'll have major speed slowdowns.

You would also need WriteFile as well to write the frame numbers. I'm not 100% certain how to do the detection. whenever I need to have avisynth make decisions about video, i use ConditionalFilter, but i don't know if you can use WriteFile with that.

can't test it now, because avisynth isn't installed on this machine. i'll see if i can get a script of sorts soon for you.