nateraw commited on
Commit
b3ce075
1 Parent(s): 91ab161

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -138,7 +138,12 @@ def predict_fn(filepath, start_sec, duration):
138
  audio_all = np.hstack((audio_all, audio))
139
 
140
  print(f"💾 Writing output video...")
141
- write_video('out.mp4', video_all, fps=fps, audio_array=audio_all, audio_fps=audio_fps, audio_codec='aac')
 
 
 
 
 
142
 
143
  print(f"✅ Done!")
144
  del video_all
138
  audio_all = np.hstack((audio_all, audio))
139
 
140
  print(f"💾 Writing output video...")
141
+
142
+ try:
143
+ write_video('out.mp4', video_all, fps=fps, audio_array=audio_all, audio_fps=audio_fps, audio_codec='aac')
144
+ except:
145
+ print("❌ Error when writing with audio...trying without audio")
146
+ write_video('out.mp4', video_all, fps=fps)
147
 
148
  print(f"✅ Done!")
149
  del video_all