for a pair of adjacent frames, compute their per-pixel differences (absolute or squared).
then you can do various statistics, like thresholding of the difference or using the differences as is, summing it all, standard deviation, histogram, …
video encoding is often “lossy”. expect tiny differences when frames look the same.