You can use a measure of similarity to a frame.
The simplest will be the SSD - Sum of Square Differences. For each two consecutive frames, calculate the difference in pixel pixels, build a square and sum over all pixels. If for a specific pair of consecutive frames the result suddenly jumps over a certain threshold, this means that the frames are different, and, most likely, a slide change took place.
Video compression will affect the threshold (higher compression = more compression artifacts = greater differences between frames => higher threshold for an acceptable difference).
source
share