Jeffgold commited on
Commit
fc7713d
·
1 Parent(s): 98b81d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
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.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,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()