Skip to content

Instantly share code, notes, and snippets.

@cnleo
Forked from NapoleonWils0n/ffmpeg combine files.sh
Created September 6, 2021 12:22
Show Gist options
  • Save cnleo/d72bae78300c0f998af41cdc4fa49171 to your computer and use it in GitHub Desktop.
Save cnleo/d72bae78300c0f998af41cdc4fa49171 to your computer and use it in GitHub Desktop.
ffmpeg: combine seperate audio and video files into a single video
#!/bin/sh
# ffmpeg combine seperate audio and video files into a single video
# copy the audio and video tracks
ffmpeg -i audio.aiff -i video.mov -acodec copy -vcodec copy -f mp4 avcombined.mp4
# encode the audio as aac and copy the video track without encoding it. if its the h264 codec
ffmpeg -i audio.aiff -i video.mov -acodec libfaac -ac 2 -ar 48000 -ab 160k -vcodec copy -f mp4 avcombined.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment