Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -19,10 +19,10 @@ def convert_video(video_file: File, quality, aspect_ratio):
|
|
19 |
if video_file is None:
|
20 |
output_path = gr.inputs.Textbox(label="Video URL")
|
21 |
else:
|
22 |
-
output_path = f"{Path(video_file).stem}.
|
23 |
|
24 |
temp_dir = tempfile.gettempdir()
|
25 |
-
ffmpeg_command = f"ffmpeg -i {video_file or output_path} -c:v libx264 -crf {quality} -f
|
26 |
subprocess.run(ffmpeg_command, shell=True)
|
27 |
|
28 |
return components.Video(output_path)
|
|
|
19 |
if video_file is None:
|
20 |
output_path = gr.inputs.Textbox(label="Video URL")
|
21 |
else:
|
22 |
+
output_path = f"{Path(video_file).stem}.mp4"
|
23 |
|
24 |
temp_dir = tempfile.gettempdir()
|
25 |
+
ffmpeg_command = f"ffmpeg -i {video_file or output_path} -c:v libx264 -crf {quality} -f {output_format} -aspect {aspect_ratio} {temp_dir}/{output_path}"
|
26 |
subprocess.run(ffmpeg_command, shell=True)
|
27 |
|
28 |
return components.Video(output_path)
|