Skip to content

Instantly share code, notes, and snippets.

@MasahiroSakoda
Last active April 30, 2024 12:00
Show Gist options
  • Save MasahiroSakoda/1e88fd69fcf234fc8aa98fff94f9d6d8 to your computer and use it in GitHub Desktop.
Save MasahiroSakoda/1e88fd69fcf234fc8aa98fff94f9d6d8 to your computer and use it in GitHub Desktop.
ffmpeg audio cheatsheet
# extract single audio stream video from multiple streamed video
ffmpeg -i input.mp4 -c:v copy -c:a copy -map 0:v -map 0:a:2 output.mp4
# Downmix 5.1 to 2ch
ffmpeg -i input.mp4 -c:v copy -c:a copy -ac 2 output.mp4
# Front Left & Right:30%, Back Left & Right:30%
ffmpeg -i input.mp4 -c:v copy -c:a copy -ac 2 -af "pan=stereo|FL=FC+0.30*FL+0.30*BL|FR=FC+0.30*FR+0.30*BR" output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment