Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ quality = gr.inputs.Dropdown(choices=["18", "23", "28", "32"], label="Quality",
|
|
10 |
aspect_ratio = gr.inputs.Dropdown(choices=["16:9", "4:3", "3:2", "2:1"], label="Aspect Ratio", default="16:9")
|
11 |
|
12 |
def convert_video(video_file: File, quality, aspect_ratio):
|
13 |
-
output_path = f"{video_file.
|
14 |
|
15 |
temp_dir = tempfile.gettempdir()
|
16 |
ffmpeg_command = f"ffmpeg -i {video_file} -c:v libx264 -crf {quality} -f hls -aspect {aspect_ratio} {temp_dir}/{output_path}"
|
@@ -19,4 +19,3 @@ def convert_video(video_file: File, quality, aspect_ratio):
|
|
19 |
return components.Video(output_path)
|
20 |
|
21 |
gr.Interface(convert_video, inputs=[video_file, quality, aspect_ratio], outputs=[components.Video()]).launch()
|
22 |
-
|
|
|
10 |
aspect_ratio = gr.inputs.Dropdown(choices=["16:9", "4:3", "3:2", "2:1"], label="Aspect Ratio", default="16:9")
|
11 |
|
12 |
def convert_video(video_file: File, quality, aspect_ratio):
|
13 |
+
output_path = f"{video_file.file_name}.m3u8"
|
14 |
|
15 |
temp_dir = tempfile.gettempdir()
|
16 |
ffmpeg_command = f"ffmpeg -i {video_file} -c:v libx264 -crf {quality} -f hls -aspect {aspect_ratio} {temp_dir}/{output_path}"
|
|
|
19 |
return components.Video(output_path)
|
20 |
|
21 |
gr.Interface(convert_video, inputs=[video_file, quality, aspect_ratio], outputs=[components.Video()]).launch()
|
|