Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -94,17 +94,22 @@ def convert_video(video_file, quality, aspect_ratio, video_url):
|
|
94 |
return output_files
|
95 |
|
96 |
# Change "video" to "file"
|
97 |
-
quality = gr.inputs.Radio(["Low", "Medium", "High"], label="Quality", default="High")
|
98 |
-
aspect_ratio = gr.inputs.Radio(["16:9", "4:3", "1:1"], label="Aspect Ratio", default="16:9")
|
99 |
video_url = gr.inputs.Textbox(placeholder="or paste video url here", label="Video URL")
|
100 |
video_file = components.File(label="Your video file")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
interface = gr.Interface(
|
103 |
fn=convert_video,
|
104 |
inputs=[video_file, quality, aspect_ratio, video_url],
|
105 |
outputs=gr.outputs.Textbox(label="Paths to Output Files"),
|
106 |
-
title="Video
|
107 |
-
description="
|
108 |
allow_flagging=False
|
109 |
)
|
110 |
|
|
|
94 |
return output_files
|
95 |
|
96 |
# Change "video" to "file"
|
|
|
|
|
97 |
video_url = gr.inputs.Textbox(placeholder="or paste video url here", label="Video URL")
|
98 |
video_file = components.File(label="Your video file")
|
99 |
+
# Define all the aspect ratios
|
100 |
+
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"]
|
101 |
+
# Define a sliding scale for the quality
|
102 |
+
quality = gr.inputs.Slider(minimum=1, maximum=50, default=23, label="Quality (1 - Speed, 50 - Quality)")
|
103 |
+
|
104 |
+
# Update the aspect ratio selection to include the comprehensive list
|
105 |
+
aspect_ratio = gr.inputs.Dropdown(choices=aspect_ratios, label="Aspect Ratio", default="16:9")
|
106 |
|
107 |
interface = gr.Interface(
|
108 |
fn=convert_video,
|
109 |
inputs=[video_file, quality, aspect_ratio, video_url],
|
110 |
outputs=gr.outputs.Textbox(label="Paths to Output Files"),
|
111 |
+
title="NEAR Hub Video Transcoder to m3u8",
|
112 |
+
description="convert video files to m3u8 for VOD streaming",
|
113 |
allow_flagging=False
|
114 |
)
|
115 |
|