Wiki‎ > ‎

Add Audio Track/Music to Movie Using FFMPEG

posted May 17, 2011, 2:24 PM by Dong Xu   [ updated May 17, 2011, 2:26 PM ]
by Cameron Wilcock

first specify your input music file, and then crop it to how long you want it to be.

ffmpeg -t 30 -acodec copy -i inputfile.mp3 outputfile.mp3

this crops it to the first 30 seconds

then using your new song file, make your new video with the music inside

ffmpeg -i Swing,Swing,Final.mp3 -acodec copy -i tester.mp4 -vcodec copy final2.mp4

the "-acodec copy" and the "-vcodec copy" both take the specifications from your two input files and uses their quality instead of the default