fffiloni commited on
Commit
cae39fd
1 Parent(s): df13102

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -85,14 +85,14 @@ def find_scenes(video_path, threshold=27.0):
85
 
86
  # STEP 2
87
  # extract first frame of each shot with cv2
88
- video = cv2.VideoCapture(video_path)
89
- fps = video.get(cv2.CAP_PROP_FPS)
90
  print('frames per second =',fps)
91
 
92
  frame_id = shot[0].get_frames() # value from scene_list from step 1
93
 
94
- video.set(cv2.CAP_PROP_POS_FRAMES, frame_id)
95
- ret, frame = video.read()
96
 
97
  # Save frame as PNG file
98
  img = str(frame_id) + '_screenshot.png'
 
85
 
86
  # STEP 2
87
  # extract first frame of each shot with cv2
88
+ vid = cv2.VideoCapture(video_path)
89
+ fps = vid.get(cv2.CAP_PROP_FPS)
90
  print('frames per second =',fps)
91
 
92
  frame_id = shot[0].get_frames() # value from scene_list from step 1
93
 
94
+ vid.set(cv2.CAP_PROP_POS_FRAMES, frame_id)
95
+ ret, frame = vid.read()
96
 
97
  # Save frame as PNG file
98
  img = str(frame_id) + '_screenshot.png'