Jeffgold commited on
Commit
b7e494d
·
1 Parent(s): 8447861

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -15
app.py CHANGED
@@ -96,20 +96,21 @@ def convert_video(video_file, quality, aspect_ratio, video_url):
96
 
97
  try:
98
  subprocess.run(ffmpeg_command, shell=True, timeout=600)
99
- except subprocess.TimeoutExpired:
100
- print("ffmpeg timed out")
101
- return "ffmpeg command timed out."
102
- except FileNotFoundError:
103
- print("ffmpeg is not installed.")
104
- return "ffmpeg is not installed."
105
-
106
- for i in range(10):
107
- if os.path.exists(output_path):
108
- break
109
- else:
110
- time.sleep(1)
111
-
112
- # The file has now been converted, so we can display it in the output viewer
113
- return output_path
 
114
 
115
  gr.Interface(convert_video, inputs=[video_file, quality, aspect_ratio, video_url], outputs='file').launch()
 
96
 
97
  try:
98
  subprocess.run(ffmpeg_command, shell=True, timeout=600)
99
+
100
+ except subprocess.TimeoutExpired:
101
+ print("ffmpeg timed out")
102
+ return "ffmpeg command timed out."
103
+ except FileNotFoundError:
104
+ print("ffmpeg is not installed.")
105
+ return "ffmpeg is not installed."
106
+
107
+ for i in range(10):
108
+ if os.path.exists(output_path):
109
+ break
110
+ else:
111
+ time.sleep(1)
112
+
113
+ # The file has now been converted, so we can display it in the output viewer
114
+ return output_path
115
 
116
  gr.Interface(convert_video, inputs=[video_file, quality, aspect_ratio, video_url], outputs='file').launch()