LoginSignup
7
6

More than 5 years have passed since last update.

opencvで動画読み込みをループする

Posted at

動画の末尾に到達したときに最初から再生する。

cap = cv2.VedeoCapture(file)
while cap.isOpened():
    (grabbed, img) = cap.read()
    if not grabbed:
        cap.set(cv2.CAP_PROP_POS_FRAMES, 0)
        continue
    ...
7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6