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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -10,10 +10,10 @@ 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.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}"
17
  subprocess.run(ffmpeg_command, shell=True)
18
 
19
  return components.Video(output_path)
 
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.path} -c:v libx264 -crf {quality} -f hls -aspect {aspect_ratio} {temp_dir}/{output_path}"
17
  subprocess.run(ffmpeg_command, shell=True)
18
 
19
  return components.Video(output_path)