ZiyuG commited on
Commit
8d20b52
1 Parent(s): 22bcc0e

Update audio.py

Browse files
Files changed (1) hide show
  1. audio.py +6 -1
audio.py CHANGED
@@ -33,7 +33,12 @@ def gen_audio(subtitles, tmpdir):
33
 
34
  return CompositeVideoClip([clip, *txt_clips])
35
 
36
- video_with_subtitles = add_subtitles(combined_clip, subtitles)
 
 
 
 
 
37
 
38
  def generate_audio(subtitles, total_duration):
39
  temp_audio_path = tempfile.mkdtemp()
 
33
 
34
  return CompositeVideoClip([clip, *txt_clips])
35
 
36
+ if len(subtitles) != 0:
37
+ video_with_subtitles = add_subtitles(combined_clip, subtitles)
38
+ else:
39
+ combined_clip.write_videofile(tmpdir + '/output_with_subtitles.mp4', fps=24)
40
+ print("Generated Video with Subtitles to:", tmpdir + '/output_with_subtitles.mp4')
41
+ return tmpdir + '/output_with_subtitles.mp4'
42
 
43
  def generate_audio(subtitles, total_duration):
44
  temp_audio_path = tempfile.mkdtemp()