Jeffgold commited on
Commit
0d3cb7b
·
1 Parent(s): 2061652

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -78,7 +78,7 @@ def convert_video(video_file, quality, aspect_ratio, video_url):
78
  # Check if the output file exists
79
  if os.path.exists(output_path):
80
  # The file already exists, so we can just display it in the output viewer
81
- return gr.outputs.File(output_path, label="Download")
82
  else:
83
  # The file does not exist, so we need to convert it
84
  ffmpeg_command = f"ffmpeg -i {input_path} -c:v libx264 -crf {quality} -vf scale=-1:720,setsar=1:1 -hls_time 6 -hls_playlist_type vod -f hls {output_path}"
@@ -99,6 +99,7 @@ def convert_video(video_file, quality, aspect_ratio, video_url):
99
  time.sleep(1)
100
 
101
  # The file has now been converted, so we can display it in the output viewer
102
- return gr.outputs.File(output_path, label="Download")
 
103
 
104
  gr.Interface(convert_video, inputs=[video_file, quality, aspect_ratio, video_url], outputs='file').launch()
 
78
  # Check if the output file exists
79
  if os.path.exists(output_path):
80
  # The file already exists, so we can just display it in the output viewer
81
+ return (output_path, "application/octet-stream")
82
  else:
83
  # The file does not exist, so we need to convert it
84
  ffmpeg_command = f"ffmpeg -i {input_path} -c:v libx264 -crf {quality} -vf scale=-1:720,setsar=1:1 -hls_time 6 -hls_playlist_type vod -f hls {output_path}"
 
99
  time.sleep(1)
100
 
101
  # The file has now been converted, so we can display it in the output viewer
102
+ return (output_path, "application/octet-stream")
103
+
104
 
105
  gr.Interface(convert_video, inputs=[video_file, quality, aspect_ratio, video_url], outputs='file').launch()