Created
July 21, 2020 15:42
-
-
Save armindocachada/5d2417ec7d2eda5cbae7e4cb2a9bb314 to your computer and use it in GitHub Desktop.
Replaces the audio for a given video file videoFilePath with the audio provided by audioFilePath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def merge_video_with_audio_ffmpeg(videoFilePath,audioFilePath,filePathOutput,start_time_audio="00:00:05"): | |
subprocess.call(['ffmpeg', '-i', videoFilePath, | |
'-itsoffset', start_time_audio, | |
'-i', audioFilePath, | |
'-c:v', 'copy', | |
'-map', '0:v:0', | |
'-map', '1:a:0', | |
filePathOutput, '-y']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment