Release video

This commit is contained in:
hzwer
2020-11-23 11:15:03 +08:00
parent 61dcb3d0d4
commit e9db322d40
2 changed files with 2 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ model.device()
videoCapture = cv2.VideoCapture(args.video)
fps = np.round(videoCapture.get(cv2.CAP_PROP_FPS))
tot_frame = videoCapture.get(cv2.CAP_PROP_FRAME_COUNT)
videoCapture.release()
if args.fps is None:
args.fps = fps * args.exp
videogen = skvideo.io.vreader(args.video)

View File

@@ -37,6 +37,7 @@ model.device()
videoCapture = cv2.VideoCapture(args.video)
fps = np.round(videoCapture.get(cv2.CAP_PROP_FPS))
videoCapture.release()
videogen = skvideo.io.vreader(args.video)
success, frame = videoCapture.read()
h, w, _ = frame.shape