We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82f3fa2 commit fdf0c2bCopy full SHA for fdf0c2b
superannotate/db/projects.py
@@ -210,16 +210,14 @@ def _get_video_frames_count(video_path):
210
Get video frames count
211
"""
212
video = cv2.VideoCapture(str(video_path), cv2.CAP_FFMPEG)
213
- total_num_of_frames = int(video.get(cv2.CAP_PROP_FRAME_COUNT))
214
- if total_num_of_frames < 0:
215
- total_num_of_frames = 0
216
- flag = True
217
- while flag:
218
- flag, _ = video.read()
219
- if flag:
220
- total_num_of_frames += 1
221
- else:
222
- break
+ total_num_of_frames = 0
+ flag = True
+ while flag:
+ flag, _ = video.read()
+ if flag:
+ total_num_of_frames += 1
+ else:
+ break
223
return total_num_of_frames
224
225
0 commit comments