My suggestion:
i = 1- Compare frame
i with frame i-1 (using, for example, the sum of the squares of the difference in pixel color intensity) - Is the difference> preset_threshold?
- If yes: the sequence below the threshold frames has just ended. Is this the longest sequence?
- If yes:
best = start of this sequence.
i++- If
i < length_of_clip : Go to 2. - Select the
best frame.
The idea is this: find the longest βsceneβ (a series of frames whose transitions are below some arbitrary threshold) and show the first frame in this series.
source share