Jeffgold commited on
Commit
3415083
·
1 Parent(s): 90e2263

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -19,7 +19,7 @@ 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"{video_file.name.split('.')[0]}.m3u8"
23
 
24
  temp_dir = tempfile.gettempdir()
25
  ffmpeg_command = f"ffmpeg -i {video_file or output_path} -c:v libx264 -crf {quality} -f hls -aspect {aspect_ratio} {temp_dir}/{output_path}"
@@ -31,3 +31,4 @@ from gradio import outputs
31
 
32
  gr.Interface(convert_video, inputs="video", outputs=[outputs.Video()]).launch()
33
 
 
 
19
  if video_file is None:
20
  output_path = gr.inputs.Textbox(label="Video URL")
21
  else:
22
+ output_path = f"{video_file.name}.m3u8"
23
 
24
  temp_dir = tempfile.gettempdir()
25
  ffmpeg_command = f"ffmpeg -i {video_file or output_path} -c:v libx264 -crf {quality} -f hls -aspect {aspect_ratio} {temp_dir}/{output_path}"
 
31
 
32
  gr.Interface(convert_video, inputs="video", outputs=[outputs.Video()]).launch()
33
 
34
+