freealise commited on
Commit
f4cc18c
1 Parent(s): f7824e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -80,6 +80,8 @@ def make_video(video_path, outdir='./vis_video_depth', encoder='vits'):
80
  raw_video = cv2.VideoCapture(filename)
81
  frame_width, frame_height = int(raw_video.get(cv2.CAP_PROP_FRAME_WIDTH)), int(raw_video.get(cv2.CAP_PROP_FRAME_HEIGHT))
82
  frame_rate = int(raw_video.get(cv2.CAP_PROP_FPS))
 
 
83
  cframes = int(raw_video.get(cv2.CAP_PROP_FRAME_COUNT))
84
  print(f'frames: {cframes}, fps: {frame_rate}')
85
  # output_width = frame_width * 2 + margin_width
 
80
  raw_video = cv2.VideoCapture(filename)
81
  frame_width, frame_height = int(raw_video.get(cv2.CAP_PROP_FRAME_WIDTH)), int(raw_video.get(cv2.CAP_PROP_FRAME_HEIGHT))
82
  frame_rate = int(raw_video.get(cv2.CAP_PROP_FPS))
83
+ if frame_rate < 1:
84
+ frame_rate = 1
85
  cframes = int(raw_video.get(cv2.CAP_PROP_FRAME_COUNT))
86
  print(f'frames: {cframes}, fps: {frame_rate}')
87
  # output_width = frame_width * 2 + margin_width