moviepy将一个视频的音频加入到另一个视频中
作者:互联网
moviepy将一个视频的音频加入到另一个视频中
import os
import moviepy.video.io.ImageSequenceClip
from moviepy.editor import VideoFileClip
def add_mp3(video_src1, video_src2, video_dst):
' 将video_src1的音频嵌入video_src2视频中'
video_src1 = VideoFileClip(video_src1)
video_src2 = VideoFileClip(video_src2)
audio = video_src1.audio
videoclip2 = video_src2.set_audio(audio)
videoclip2.write_videofile(video_dst, codec='libx264')
video_src2 = 'E:\\VideoData\\VideoSRC\\src1.mp4'
video_src2 = 'E:\\VideoData\\VideoSRC\\src2.mp4'
video_dst = 'E:\\VideoData\\VideoDST\\11.mp4'
add_mp3(video_src1, video_src2, video_dst)
标签:视频,moviepy,音频,src2,src1,video,audio,dst 来源: https://blog.csdn.net/Joseph__Lagrange/article/details/112119817