I was looking at a real time problem where we need to eliminate the redundant frames of a video.(May be a video with lyrics of a song) In my example, lyrics video song, we are not concerned about the audio. Only frames containing the lyrics. but the thing is 2 line of lyrics my end up with 20seconds ending up with multiple frames having the same lyrics. So I was interested in eliminating those redundant frames.
While searching, I have found this code to extract frames from a video by this - Python - Extracting and Saving Video Frames
import cv2
vidcap = cv2.VideoCapture('Compton.mp4')
success,image = vidcap.read()
count = 0
success = True
while success:
success,image = vidcap.read()
cv2.imwrite("frame%d.jpg" % count, image) # save frame as JPEG file
if cv2.waitKey(10) == 27: # exit if Escape is hit
break
count += 1
Can you please help me how to proceed in order to eliminate the redundant frames from here on.