Skip to content

How to merge multiple mp3s into one track with FFmpeg?

This is question 80 from my up and coming FFMPEG book, come join the mailing list to stay informed on more FFMPEG tutorials and announcements about the book. Here

Merging audio with FFMPEG is one of the most searched questions on the internet and couldn’t be any easier. The only difference is a txt file with a list of mp3 tracks must be made before the merging can begin. Below is an example list inside the file “file.txt”:

file 'track1.mp3'
file 'track2.mp3'
file 'track3.mp3'

Next, using concat in the following one-liner, all 3 mp3 files can be merged into one long track:

 $ ffmpeg -f concat -i file.txt -c copy full.mp3  

concat or concatenate, is the process of combining media files. In this example, exactly the same codec and parameters are required for joining. 

In this example, ffmpeg lacks a specific media file as an input but a list from a external list (file.txt), this -f is used to “force” and input file.

Arguments

concat

Indicates the argument that combines multiple media files

-f 

Indicates the forces an input or output

Love FFmpeg? Grab a copy of FFmpeg For Beginners on Kindle or Paperback to learn over 120 ways to master FFmpeg!

buy now on amazon