Last active
May 28, 2021 08:37
-
-
Save springcoil/c403139b571756324f3e0287cd8a2153 to your computer and use it in GitHub Desktop.
audio_download_create_youtube_3.py
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 combine_audio(video, speech, audio): | |
os.system(f'ffmpeg -i {video} -i {speech} -filter_complex "[0:a]volume=0.4[a0]; [1:a]volume=0.9[a1]; [a0][a1]amix=duration=longest[a]" -map 0:v -map "[a]" -c:v copy overlayAudio.mp4') | |
os.system(f'ffmpeg -i {video} -i {audio} -filter_complex "[0:a]volume=0.0[a0]; [1:a]volume=1.0[a1]; [a0][a1]amix=duration=longest[a]" -map 0:v -map "[a]" -c:v copy substituteAudio.mp4') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment