Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -40,11 +40,11 @@ video_url = gr.inputs.Textbox(label="Video URL")
|
|
40 |
|
41 |
def convert_video(video_file: File, quality, aspect_ratio, video_url):
|
42 |
if video_file is None:
|
43 |
-
|
44 |
-
else:
|
45 |
-
output_path = f"{temp_dir}/{Path(video_file).name}.m3u8"
|
46 |
|
47 |
-
|
|
|
|
|
48 |
subprocess.run(ffmpeg_command, shell=True)
|
49 |
|
50 |
return components.Video(output_path)
|
|
|
40 |
|
41 |
def convert_video(video_file: File, quality, aspect_ratio, video_url):
|
42 |
if video_file is None:
|
43 |
+
video_file = Path(video_url)
|
|
|
|
|
44 |
|
45 |
+
output_path = f"{temp_dir}/{video_file.name}.m3u8"
|
46 |
+
|
47 |
+
ffmpeg_command = f"ffmpeg -i {video_file} -c:v libx264 -crf {quality} -f hls -aspect {aspect_ratio} {output_path}"
|
48 |
subprocess.run(ffmpeg_command, shell=True)
|
49 |
|
50 |
return components.Video(output_path)
|