Skip to content

Instantly share code, notes, and snippets.

@NapoleonWils0n
Created November 4, 2012 00:26
Show Gist options
  • Save NapoleonWils0n/4009554 to your computer and use it in GitHub Desktop.
Save NapoleonWils0n/4009554 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
@NapoleonWils0n
Copy link
Author

hi mate, try this combine-clips

https://github.com/NapoleonWils0n/ffmpeg-scripts?tab=readme-ov-file#combine-clips

https://github.com/NapoleonWils0n/ffmpeg-scripts/blob/master/combine-clips

https://github.com/NapoleonWils0n/ffmpeg-scripts

also the video shouldnt be in a mp4 container which is for video
aac audio should be a file with a .m4a or .aac file extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment