Play from the beginning when the end of the video is reached.
cap = cv2.VedeoCapture(file)
while cap.isOpened():
(grabbed, img) = cap.read()
if not grabbed:
cap.set(cv2.CAP_PROP_POS_FRAMES, 0)
continue
...
Recommended Posts