Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -97,12 +97,10 @@ def upload_file_to_s3(file_path, s3_path):
|
|
| 97 |
file.write(file_content)
|
| 98 |
|
| 99 |
def convert_video(video_file, quality, aspect_ratio, video_url):
|
| 100 |
-
|
| 101 |
-
def convert_video(video_file, quality, aspect_ratio, video_url):
|
| 102 |
# Ensure either a file or a URL is provided
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
input_path = get_input_path(video_file, video_url)
|
| 107 |
|
| 108 |
video = VideoFileClip(str(input_path))
|
|
@@ -149,7 +147,6 @@ def convert_video(video_file, quality, aspect_ratio, video_url):
|
|
| 149 |
output_html = "<br>".join(output_links)
|
| 150 |
return output_html
|
| 151 |
|
| 152 |
-
|
| 153 |
video_file = gr.inputs.File(label="Your video file")
|
| 154 |
quality = gr.inputs.Slider(minimum=1, maximum=50, label="Quality (1:Speed - 50:Quality)")
|
| 155 |
aspect_ratio = gr.inputs.Dropdown(["16:9", "4:3", "1:1", "3:4", "9:16", "1:1", "2:1", "1:2"], label="Aspect Ratio", default="16:9")
|
|
|
|
| 97 |
file.write(file_content)
|
| 98 |
|
| 99 |
def convert_video(video_file, quality, aspect_ratio, video_url):
|
|
|
|
|
|
|
| 100 |
# Ensure either a file or a URL is provided
|
| 101 |
+
if not video_file and not video_url:
|
| 102 |
+
raise ValueError("Please provide either a video file or a video URL.")
|
| 103 |
+
|
| 104 |
input_path = get_input_path(video_file, video_url)
|
| 105 |
|
| 106 |
video = VideoFileClip(str(input_path))
|
|
|
|
| 147 |
output_html = "<br>".join(output_links)
|
| 148 |
return output_html
|
| 149 |
|
|
|
|
| 150 |
video_file = gr.inputs.File(label="Your video file")
|
| 151 |
quality = gr.inputs.Slider(minimum=1, maximum=50, label="Quality (1:Speed - 50:Quality)")
|
| 152 |
aspect_ratio = gr.inputs.Dropdown(["16:9", "4:3", "1:1", "3:4", "9:16", "1:1", "2:1", "1:2"], label="Aspect Ratio", default="16:9")
|