File size: 357 Bytes
ffb16dc
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
from moviepy.editor import *

def Video_dub(video_path,audio_path):
  output_filename = "video_with_new_audio.mp4"
  video_clip = VideoFileClip(video_path)
  audio_clip = AudioFileClip(audio_path)
  video_clip = video_clip.set_audio(None)
  video_clip = video_clip.set_audio(audio_clip)
  video_clip.write_videofile(output_filename)
  return output_filename