fffiloni commited on
Commit
7bb51ba
1 Parent(s): 0e2a0ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -11,8 +11,15 @@ def get_frames(video_in):
11
  frames = []
12
  #resize the video
13
  clip = VideoFileClip(video_in)
14
- clip_resized = clip.resize(height=512)
15
- clip_resized.write_videofile("video_resized.mp4")
 
 
 
 
 
 
 
16
  print("video resized to 512 height")
17
 
18
  # Opens the Video file with CV2
 
11
  frames = []
12
  #resize the video
13
  clip = VideoFileClip(video_in)
14
+ if clip.fps > 30:
15
+ print("vide rate is over 30, resetting to 30")
16
+ clip_resized = clip.resize(height=512)
17
+ clip_resized.write_videofile("video_resized.mp4", fps=30)
18
+ else:
19
+ print("video rate is OK")
20
+ clip_resized = clip.resize(height=512)
21
+ clip_resized.write_videofile("video_resized.mp4", fps=clip.fps)
22
+
23
  print("video resized to 512 height")
24
 
25
  # Opens the Video file with CV2