View Full Version : Built-in scene detection in AviSynth?
What if AviSynth had a build-in scene change detection?
At least most temporal filters (should) implement their own scene change detector, thus the detection is done more than once if several temporal filters are being used. A built-in scene change detection could e.g. set a flag at the first frame of a new scene.
This way every newly developped filter could profit from the flag, and it would no longer be necessary to waste brain cells on how to implement another scene change detection in it.
What do you think?
bb
sh0dan
16th July 2003, 18:29
We have had the problem with per-frame flags discussed earlier.
The major problem is that many filters create a new frame, with no relation to the "source" frame - so there is no way for information to be passed from one frame to another. So more than 50% of all filters will kill the information when frames pass through them.
So - for now it cannot be very well put into the current framework.
Doing simple scenechange detection is very easy and fast - there is code in temporalsoften that can easily be used. MipSmooth also implements the same routine. Futhermore filters can invoke the internal "YDifferenceToPrevious()" / "YDifferenceToNext()".
Maybe Bidoche has some comment on the 3.0 framework?
Bidoche
16th July 2003, 23:22
Your request arises two issues :
- the first is the one raised by sh0dan :
you may be happy to have the flags to use in your filter but then you will have to make sure you pass it correctly which may be really complex in some case.
- the second is that scene changes is a relation between frames concept, therefore it's no wonder trying to fit it to a frame is tricky. It would better belong to clips...
But that would make another method to correctly forward by filters, and probably as complex as with frame tags.
Conclusion :
Both the frame solution and clip one are big work for not that much of a gain.
In those cases, one should remember the KISS rule and since we already have something satisfactory stick with it (YDifferenceFromPrevious or to speak 3.0 a bool IsSceneChange(frame before, frame after) function)
Edit: the problem of correct properties forwarding is really tricky, I don't really know how to handle it.
There are the cases of properties who lose sense when edition is performed, collisions case (what to do when we merge two frames into one)...
Edit2 : we can consider a filter that mark frames with scene change info for other to use, but a complete forwarding is out of question.
You will still have a limited forwarding, some will work and some won't.
Too bad that there's not an easy solution...
:(
bb
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.