Jeffgold commited on
Commit
852120d
·
1 Parent(s): db68444

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -16
app.py CHANGED
@@ -95,21 +95,21 @@ def convert_video(video_file, quality, aspect_ratio, video_url):
95
  print(f"Output Path: {output_path}")
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()
 
95
  print(f"Output Path: {output_path}")
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()