Skip to content

Instantly share code, notes, and snippets.



Last active Oct 24, 2020
What would you like to do?
just so i have this next time i want to dub some audio with ffmpeg
# mix two audio streams together:
youtube-dl "" -f best -o burnafterreading.mp4
youtube-dl "" -f best -o chromatica.mp4
ffmpeg \
-ss 77.2 \ # skip first 77.2 seconds of first input
-i burnafterreading.mp4 \
-i chromatica.mp4 \
-filter_complex "[0:1][1:1] amix=inputs=2:weights=2 1" \ # mix track 1 (audio) of inputs 0 and 1, make audio 0 twice as loud as 1
-map 0:0 \ # use track 0 (video) from input 0
-c:a aac -strict -2 \ # don't think this is necessary, default encoder settings should be fine
-t 49 \ # trim output to 49 seconds long
# replace audio:
ffmpeg -i input.mp4 -i input.wav -c:v copy -map 0:v:0 -map 1:a:0 output.mp4 -c:a aac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment