Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,8 +11,15 @@ def get_frames(video_in):
|
|
| 11 |
frames = []
|
| 12 |
#resize the video
|
| 13 |
clip = VideoFileClip(video_in)
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|