Im am working on processing a video and one of the steps that I need to perform is extract a specific frame out of the video.
cap = cv2.VideoCapture(videoFile)
for frame in range(startFrame, endFrame):
cap.set(cv2.CAP_PROP_POS_FRAMES, frame)
print frame
position = cap.get(cv2.CAP_PROP_POS_FRAMES)
print position
Ideally, frame and position should be equal. This is initially true. However after 2 or 3 loops the position becomes -2.04963823041e+15. I am very confused by this. I am running this on an amazonaws server with anaconda and OpenCV 3.