jbilcke-hf commited on
Commit
e38d841
·
1 Parent(s): a3347a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -52,12 +52,12 @@ def get_frames(video_in, step, name):
52
  #check fps
53
  if clip.fps > 30:
54
  print("vide rate is over 30, resetting to 30")
55
- clip_resized = clip.resize(height=512)
56
- clip_resized.write_videofile("video_resized.mp4", fps=30, bitrate="10000k")
57
  else:
58
  print("video rate is OK")
59
- clip_resized = clip.resize(height=512)
60
- clip_resized.write_videofile("video_resized.mp4", fps=clip.fps, bitrate="10000k")
61
 
62
  print("video resized to 512 height")
63
 
@@ -85,7 +85,7 @@ def get_frames(video_in, step, name):
85
  def create_video(frames, fps, type):
86
  print("building video result")
87
  clip = ImageSequenceClip(frames, fps=fps)
88
- clip.write_videofile(type + "_result.mp4", fps=fps, bitrate="5000k")
89
 
90
  return type + "_result.mp4"
91
 
@@ -154,7 +154,7 @@ with gr.Blocks() as demo:
154
  secret_token = gr.Textbox(label="Secret token")
155
  video_input = gr.Textbox(label="Video Base64")
156
 
157
- interpolation = gr.Slider(minimum=1, maximum=4, step=1, value=4, label="Interpolation Steps")
158
  fps_output = gr.Slider(minimum=1, maximum=64, step=1, value=24, label="FPS output")
159
  submit_btn = gr.Button("Submit")
160
 
 
52
  #check fps
53
  if clip.fps > 30:
54
  print("vide rate is over 30, resetting to 30")
55
+ clip_resized = clip.resize(height=576)
56
+ clip_resized.write_videofile("video_resized.mp4", fps=30, bitrate="12000k")
57
  else:
58
  print("video rate is OK")
59
+ clip_resized = clip.resize(height=576)
60
+ clip_resized.write_videofile("video_resized.mp4", fps=clip.fps, bitrate="12000k")
61
 
62
  print("video resized to 512 height")
63
 
 
85
  def create_video(frames, fps, type):
86
  print("building video result")
87
  clip = ImageSequenceClip(frames, fps=fps)
88
+ clip.write_videofile(type + "_result.mp4", fps=fps, bitrate="12000k")
89
 
90
  return type + "_result.mp4"
91
 
 
154
  secret_token = gr.Textbox(label="Secret token")
155
  video_input = gr.Textbox(label="Video Base64")
156
 
157
+ interpolation = gr.Slider(minimum=1, maximum=6, step=1, value=4, label="Interpolation Steps")
158
  fps_output = gr.Slider(minimum=1, maximum=64, step=1, value=24, label="FPS output")
159
  submit_btn = gr.Button("Submit")
160