Skip to content

Commit

Permalink
Fix frame.time_base if it is too small(too short)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanyazou committed Nov 24, 2018
1 parent 7749936 commit 6522883
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tellopy/examples/video_effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ def main():
cv2.imshow('Original', image)
cv2.imshow('Canny', cv2.Canny(image, 100, 200))
cv2.waitKey(1)
frame_skip = int((time.time() - start_time)/frame.time_base)
if frame.time_base < 1.0/60:
time_base = 1.0/60
else:
time_base = frame.time_base
frame_skip = int((time.time() - start_time)/time_base)


except Exception as ex:
exc_type, exc_value, exc_traceback = sys.exc_info()
Expand Down

0 comments on commit 6522883

Please sign in to comment.