Extended replace duplicate frame function

I tried the function of replacing repeated frames, and I think it still has room for expansion. According to a similar logic, it can also solve black frames (up to tens of frames of completely black images) and flickering (scenes with only a few frames in the video, which are discontinuous before and after, and only flicker can be seen in actual playback).
The latter is probably less encountered, but fixing it can significantly improve video quality. The actual implementation may need to rely on transition detection, which is very useful for those who need it.