Merge pull request #243 from yqtl/extract_video_fix

fix --step argument
This commit is contained in:
Qing Shuai 2023-02-11 20:54:34 +08:00 committed by GitHub
commit e287c6bd81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,8 @@ def extract_video(videoname, path, start, end, step):
if cnt < start:continue
if cnt >= end:break
if not ret:continue
cv2.imwrite(join(outpath, '{:06d}.jpg'.format(cnt)), frame)
if (cnt % step ==0):
cv2.imwrite(join(outpath, '{:06d}.jpg'.format(cnt)), frame)
video.release()
return base