Update slideclip.py

This commit is contained in:
deflax 2022-04-01 05:20:11 +03:00 committed by GitHub
parent b431b87ee2
commit fe96032e6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,15 +62,10 @@ video_clip.set_duration(audio_clip.duration)
video_clip.write_videofile("tmpvideo.mp4", fps=FPS, codec=VCODEC) video_clip.write_videofile("tmpvideo.mp4", fps=FPS, codec=VCODEC)
print ('Muxing audio and video...') print ('Muxing audio and video...')
final = VideoFileClip('tmpvideo.mp4') final_audio = AudioFileClip('tmpaudio.mp3')
final.set_audio(audio_clip) final_video = VideoFileClip('tmpvideo.mp4')
final_video = final_video.set_audio(final_audio.set_duration(final_audio.duration))
final.write_videofile('output.mp4', final_video.write_videofile('output.mp4', fps=FPS)
fps=FPS,
codec=VCODEC,
audio_codec=ACODEC,
remove_temp=True
)
# Cleanup # Cleanup
os.unlink('tmpvideo.mp4') os.unlink('tmpvideo.mp4')