Skip to content

Commit 2411bd6

Browse files
committed
Added exception handling for low or missing parsed fps values.
1 parent 96d8b08 commit 2411bd6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

utils/track/operators.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ def execute(self, context):
131131

132132
# get the fps of the clip and set the environment accordingly
133133
fps = cap.get(cv2.CAP_PROP_FPS)
134+
if fps < 1:
135+
fps == 30
136+
print("\nWARNING: Invalid FPS value read from input file. Defaulting to FPS = 30")
134137
video_width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
135138
video_height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
136139

0 commit comments

Comments
 (0)