Update slideclip.py
This commit is contained in:
parent
b431b87ee2
commit
fe96032e6e
1 changed files with 4 additions and 9 deletions
13
slideclip.py
13
slideclip.py
|
@ -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')
|
||||||
|
|
Loading…
Reference in a new issue