Last active
March 20, 2021 00:03
-
-
Save rolandcrosby/0a03bf6b3e67591fb4afe68785344b87 to your computer and use it in GitHub Desktop.
just so i have this next time i want to dub some audio with ffmpeg
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
# mix two audio streams together: | |
youtube-dl "https://www.youtube.com/watch?v=c38HJR-9vhU" -f best -o burnafterreading.mp4 | |
youtube-dl "https://www.youtube.com/watch?v=Pqh63ca__mM" -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 | |
output.mp4 | |
# replace audio: | |
ffmpeg -i input.mp4 -i input.wav -c:v copy -map 0:v:0 -map 1:a:0 -c:a aac -shortest output.mp4 | |
# crop and overlay a transparent png: | |
ffmpeg -i fergorig.mp4 -i wombo.png \ | |
-filter_complex '[0:v]crop=240:240:80:0[a]; [a][1:v] overlay=140:0' \ | |
-pix_fmt yuv420p -c:a copy out.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment