Skip to content

Instantly share code, notes, and snippets.

@mobilemind
Created February 3, 2018 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mobilemind/94f53ec0b46c3360146c710efd4fa6c1 to your computer and use it in GitHub Desktop.
Save mobilemind/94f53ec0b46c3360146c710efd4fa6c1 to your computer and use it in GitHub Desktop.
# strip audio from a video and save as m4a
ffmpeg -i input.mp4 -vn -c:a copy output.m4a
# replace audio track with audio track in identical (m4a) format
ffmpeg.exe -i input_video.mp4 -i replacement_audio.m4a -vcodec copy -acodec copy -map 0:0 -map 1:0 output.mp4
# replace audio, matching file's audio codec (encodes only audio)
ffmpeg.exe -i input_video.mp4 -i replacement_audio.m4a -vcodec copy -map 0:0 -map 1:0 output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment