Jeffgold commited on
Commit
bc77f0a
·
1 Parent(s): 9985157

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -97,20 +97,18 @@ def convert_video(video_file, quality, aspect_ratio, video_url):
97
  return output_html
98
 
99
  # Change "video" to "file"
100
- video_url = gr.inputs.Textbox(placeholder="or paste video url here", label="Video URL")
101
- video_file = components.File(label="Your video file")
102
- # Define all the aspect ratios
103
- aspect_ratios = ["1:1", "4:3", "16:9", "3:2", "21:9", "2.35:1", "2.39:1", "2.40:1", "1.85:1", "4:5", "9:16", "360"]
104
- # Define a sliding scale for the quality
105
- quality = gr.inputs.Slider(minimum=1, maximum=50, default=23, label="Quality (1 - Speed, 50 - Quality)")
106
 
107
  # Update the aspect ratio selection to include the comprehensive list
108
  aspect_ratio = gr.inputs.Dropdown(choices=aspect_ratios, label="Aspect Ratio", default="16:9")
109
 
110
- interface = gr.Interface(
111
  fn=convert_video,
112
  inputs=[video_file, quality, aspect_ratio, video_url],
113
- outputs=gr.outputs.HTML(label="Download Links"),
114
  title="NEAR Hub Video Transcoder to m3u8",
115
  description="convert video files to m3u8 for VOD streaming",
116
  allow_flagging=False
 
97
  return output_html
98
 
99
  # Change "video" to "file"
100
+ video_file = gradio.inputs.File(label="Your video file")
101
+ quality = gradio.inputs.Slider(minimum=1, maximum=50, default=25, label="Quality (1:Speed - 50:Quality)")
102
+ aspect_ratio = gradio.inputs.Dropdown(["16:9", "4:3", "1:1", "3:4", "9:16", "1:1", "2:1", "1:2"], label="Aspect Ratio", default="16:9")
103
+ video_url = gradio.inputs.Textbox(lines=1, placeholder="or paste video url here", label="Video URL")
 
 
104
 
105
  # Update the aspect ratio selection to include the comprehensive list
106
  aspect_ratio = gr.inputs.Dropdown(choices=aspect_ratios, label="Aspect Ratio", default="16:9")
107
 
108
+ interface = gradio.Interface(
109
  fn=convert_video,
110
  inputs=[video_file, quality, aspect_ratio, video_url],
111
+ outputs=gradio.outputs.HTML(label="Download Links"),
112
  title="NEAR Hub Video Transcoder to m3u8",
113
  description="convert video files to m3u8 for VOD streaming",
114
  allow_flagging=False