I have a load of time-lapse videos created from some cheap IP cameras that look like this:


They're cool, and very effective, but due to the cheapness of the cameras, the effects of a harsh winter and the poor ADSL broadband at the remote location there are lots of corrupted frames. Is there a way to programatically remove or drop the corrupted frames? I was wondering if there was a way of checksumming the frames, and then removing anything that was outside of an accepted "range" of values. For example, if 40%+ of the frame was pink, then it would clearly be outside of the expected range.

As there's no accompanying audio, it wouldn't cause an issue for loss of sync in this regard. If it helps, the cameras/software produce accompanying JPG's for every frame in the video, so if it were easier to look at each of these JPG's and delete the corrupted ones before re-combining into a video then that would be possible to do.

Any ideas?