Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,7 +71,7 @@ def create_master_playlist(output_paths, temp_dir):
|
|
| 71 |
return master_playlist_path
|
| 72 |
|
| 73 |
def convert_video(video_file, quality, aspect_ratio, video_url, api_key, upload):
|
| 74 |
-
standard_resolutions = [4320, 2160, 1440, 1080, 720, 480] # 8K, 4K, 2K, Full HD, HD, SD in pixels
|
| 75 |
|
| 76 |
with tempfile.TemporaryDirectory() as temp_dir:
|
| 77 |
temp_dir = Path(temp_dir)
|
|
@@ -149,22 +149,22 @@ def process_output(output):
|
|
| 149 |
raise TypeError("Unexpected output type")
|
| 150 |
|
| 151 |
def main():
|
| 152 |
-
video_file = gr.inputs.File(label="Video File")
|
| 153 |
-
quality = gr.inputs.Dropdown(
|
| 154 |
choices=["18", "23", "27", "28", "32"], label="Quality", default="27")
|
| 155 |
-
aspect_ratio = gr.inputs.Dropdown(
|
| 156 |
choices=["16:9", "1:1", "4:3", "3:2", "5:4", "21:9",
|
| 157 |
"1.85:1", "2.35:1", "3:1", "360", "9:16", "16:9",
|
| 158 |
"2:1", "1:2", "9:1"],
|
| 159 |
label="Aspect Ratio", default="16:9")
|
| 160 |
-
video_url = gr.inputs.Textbox(label="Video URL")
|
| 161 |
-
api_key = gr.inputs.Textbox(label="web3.storage API Key")
|
| 162 |
-
upload = gr.inputs.Checkbox(label="Upload to web3.storage", default=False)
|
| 163 |
|
| 164 |
gr.Interface(
|
| 165 |
convert_video,
|
| 166 |
inputs=[video_file, quality, aspect_ratio, video_url, api_key, upload],
|
| 167 |
-
outputs=gr.outputs.
|
| 168 |
output_processor=process_output,
|
| 169 |
allow_flagging=False,
|
| 170 |
live=False,
|
|
|
|
| 71 |
return master_playlist_path
|
| 72 |
|
| 73 |
def convert_video(video_file, quality, aspect_ratio, video_url, api_key, upload):
|
| 74 |
+
standard_resolutions = [4320, 2160, 1440, 1080, 720, 480, 360, 240, 144] # 8K, 4K, 2K, Full HD, HD, SD in pixels
|
| 75 |
|
| 76 |
with tempfile.TemporaryDirectory() as temp_dir:
|
| 77 |
temp_dir = Path(temp_dir)
|
|
|
|
| 149 |
raise TypeError("Unexpected output type")
|
| 150 |
|
| 151 |
def main():
|
| 152 |
+
video_file = gr.components.inputs.File(label="Video File")
|
| 153 |
+
quality = gr.components.inputs.Dropdown(
|
| 154 |
choices=["18", "23", "27", "28", "32"], label="Quality", default="27")
|
| 155 |
+
aspect_ratio = gr.components.inputs.Dropdown(
|
| 156 |
choices=["16:9", "1:1", "4:3", "3:2", "5:4", "21:9",
|
| 157 |
"1.85:1", "2.35:1", "3:1", "360", "9:16", "16:9",
|
| 158 |
"2:1", "1:2", "9:1"],
|
| 159 |
label="Aspect Ratio", default="16:9")
|
| 160 |
+
video_url = gr.components.inputs.Textbox(label="Video URL")
|
| 161 |
+
api_key = gr.components.inputs.Textbox(label="web3.storage API Key")
|
| 162 |
+
upload = gr.components.inputs.Checkbox(label="Upload to web3.storage", default=False)
|
| 163 |
|
| 164 |
gr.Interface(
|
| 165 |
convert_video,
|
| 166 |
inputs=[video_file, quality, aspect_ratio, video_url, api_key, upload],
|
| 167 |
+
outputs=gr.outputs.Markdown(),
|
| 168 |
output_processor=process_output,
|
| 169 |
allow_flagging=False,
|
| 170 |
live=False,
|