fffiloni commited on
Commit
e8e0d42
1 Parent(s): 06a53f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -110,18 +110,18 @@ def get_frames(video_in, img_type):
110
  frames = []
111
  #resize the video
112
  # Cut the video to the first 5 seconds
113
- video_out = f"{img_type}_video_cut.mp4"
114
 
115
- ffmpeg_extract_subclip(video_in, t1=0, t2=3, targetname=video_out)
116
  # Now, proceed with resizing the cut video
117
- clip = VideoFileClip(video_out)
118
 
119
  #check fps
120
 
121
- if clip.fps > 24:
122
- print("vide rate is over 24, resetting to 24")
123
  clip_resized = clip.resize(width=512)
124
- clip_resized.write_videofile(f"{img_type}_video_resized.mp4", fps=24)
125
  else:
126
  print("video rate is OK")
127
  clip_resized = clip.resize(width=512)
 
110
  frames = []
111
  #resize the video
112
  # Cut the video to the first 5 seconds
113
+ #video_out = f"{img_type}_video_cut.mp4"
114
 
115
+ #ffmpeg_extract_subclip(video_in, t1=0, t2=3, targetname=video_out)
116
  # Now, proceed with resizing the cut video
117
+ clip = VideoFileClip(video_in)
118
 
119
  #check fps
120
 
121
+ if clip.fps > 30:
122
+ print("vide rate is over 30, resetting to 30")
123
  clip_resized = clip.resize(width=512)
124
+ clip_resized.write_videofile(f"{img_type}_video_resized.mp4", fps=30)
125
  else:
126
  print("video rate is OK")
127
  clip_resized = clip.resize(width=512)