Update app.py
Browse files
app.py
CHANGED
@@ -42,10 +42,11 @@ def get_frames(video_in, step, name):
|
|
42 |
frames = []
|
43 |
#resize the video
|
44 |
clip = VideoFileClip(video_in)
|
|
|
45 |
|
46 |
#check fps
|
47 |
if clip.fps > 25:
|
48 |
-
print("
|
49 |
clip_resized = clip.resize(height=1024)
|
50 |
clip_resized.write_videofile("video_resized.mp4", fps=25)
|
51 |
else:
|
@@ -56,7 +57,7 @@ def get_frames(video_in, step, name):
|
|
56 |
print("video resized to 1024 height")
|
57 |
|
58 |
# Opens the Video file with CV2
|
59 |
-
cap= cv2.VideoCapture("video_resized.mp4")
|
60 |
|
61 |
fps = cap.get(cv2.CAP_PROP_FPS)
|
62 |
print("video fps: " + str(fps))
|
|
|
42 |
frames = []
|
43 |
#resize the video
|
44 |
clip = VideoFileClip(video_in)
|
45 |
+
print("video fps: " + str(clip.fps))
|
46 |
|
47 |
#check fps
|
48 |
if clip.fps > 25:
|
49 |
+
print("video rate is over 25, resetting to 25")
|
50 |
clip_resized = clip.resize(height=1024)
|
51 |
clip_resized.write_videofile("video_resized.mp4", fps=25)
|
52 |
else:
|
|
|
57 |
print("video resized to 1024 height")
|
58 |
|
59 |
# Opens the Video file with CV2
|
60 |
+
cap = cv2.VideoCapture("video_resized.mp4")
|
61 |
|
62 |
fps = cap.get(cv2.CAP_PROP_FPS)
|
63 |
print("video fps: " + str(fps))
|