Can anyone help me to trim the audio file to match the video length? At the moment the video finishes at 8 seconds but it plays for 2min+
clip = VideoFileClip("video.mp4")
clip_duration = clip.duration
audioclip = AudioFileClip("huru.wav")
new_audioclip = CompositeAudioClip([audioclip])
clip.audio = new_audioclip
txt_clip = TextClip("Some Text",fontsize=70,color='black')
txt_clip = txt_clip.set_pos("bottom","center").set_duration(clip_duration)
video = CompositeVideoClip([clip, txt_clip])
video.write_videofile("video2.mp4")
Instead of
audioclip = AudioFileClip("huru.wav")
new_audioclip = CompositeAudioClip([audioclip])
clip.audio = new_audioclip
try
audioclip = AudioFileClip("huru.wav").set_duration(clip_duration)
new_audioclip = CompositeAudioClip([audioclip])
clip = clip.set_audio(new_audioclip)
you can use set_start()
too