from moviepy.editor import * # 指定视频文件和音频文件路径 video_path = r'F:\存储盘\古风美女素材下载\舞蹈视频\1476732110-1-100113.mp4' audio_path = r'F:\存储盘\古风美女素材下载\舞蹈视频\1xiaoshi.MP3' # 加载视频和音频 video = VideoFileClip(video_path) audio = AudioFileClip(audio_path) # 将音频添加到视频中 video = video.set_audio(audio) # 输出合并后的视频文件 output_path = r'F:\存储盘\古风美女素材下载\舞蹈视频\output.mp4' video.write_videofile(output_path, codec='libx264', audio_codec='aac')
标签:视频,python,音频,video,output,path,audio From: https://www.cnblogs.com/jingzaixin/p/18109061