Jeffgold commited on
Commit
3921858
·
1 Parent(s): efe2e21

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -5,6 +5,7 @@ import subprocess
5
  from pathlib import Path
6
  from moviepy.editor import VideoFileClip
7
  import gradio as gr
 
8
  import requests
9
  from urllib.parse import urlparse
10
 
@@ -95,17 +96,17 @@ def convert_video(video_file, quality, aspect_ratio, video_url, api_key, upload)
95
  return output_copy_path
96
 
97
  def main():
98
- video_file = gr.inputs.File(label="Video File", type="file")
99
- quality = gr.inputs.Dropdown(
100
  choices=["18", "23", "28", "32"], label="Quality", default="23")
101
- aspect_ratio = gr.inputs.Dropdown(
102
  choices=[None, "1:1", "4:3", "3:2", "5:4", "16:9", "21:9",
103
  "1.85:1", "2.35:1", "3:1", "360", "9:16", "16:9",
104
  "2:1", "1:2", "9:1"],
105
  label="Aspect Ratio", default=None)
106
- video_url = gr.inputs.Textbox(label="Video URL")
107
- api_key = gr.inputs.Textbox(label="web3.storage API Key")
108
- upload = gr.inputs.Checkbox(label="Upload to web3.storage", default=False)
109
 
110
  gr.Interface(
111
  convert_video,
@@ -113,5 +114,6 @@ def main():
113
  outputs='text'
114
  ).launch()
115
 
 
116
  if __name__ == "__main__":
117
  main()
 
5
  from pathlib import Path
6
  from moviepy.editor import VideoFileClip
7
  import gradio as gr
8
+ import gradio.components as gr
9
  import requests
10
  from urllib.parse import urlparse
11
 
 
96
  return output_copy_path
97
 
98
  def main():
99
+ video_file = gr.components.Input(label="Video File", type="file")
100
+ quality = gr.components.Dropdown(
101
  choices=["18", "23", "28", "32"], label="Quality", default="23")
102
+ aspect_ratio = gr.components.Dropdown(
103
  choices=[None, "1:1", "4:3", "3:2", "5:4", "16:9", "21:9",
104
  "1.85:1", "2.35:1", "3:1", "360", "9:16", "16:9",
105
  "2:1", "1:2", "9:1"],
106
  label="Aspect Ratio", default=None)
107
+ video_url = gr.components.Textbox(label="Video URL")
108
+ api_key = gr.components.Textbox(label="web3.storage API Key")
109
+ upload = gr.components.Checkbox(label="Upload to web3.storage", default=False)
110
 
111
  gr.Interface(
112
  convert_video,
 
114
  outputs='text'
115
  ).launch()
116
 
117
+
118
  if __name__ == "__main__":
119
  main()