I want to loop frames from a certain range, and append it to an array. The thing is that, it's too slow. I already check how long the function would take and i think that's pretty slow. Here is my current code:
imgs = []
for j in range(range1, range2):
video.set(cv.CAP_PROP_POS_FRAMES, j)
ret, frame = video.read()
imgs.append(frame)
i also tried to replace imgs.append(frame) with video.retrieve(video.grab()), but the performance didn't really differs much. Is there any better solution/alternative to do what this code does??