FFmpeg Example | Concatenate Two MP3 Files to One

This ffmpeg example code will show you how to concatenate two mp3 files to one file.

1. Create a text file containing two mp3 files

file '/path/to/first.mp3'
file '/path/to/second.mp3'

2. concatenate 

ffmpeg -f concat -i list.txt -c copy out.mp3

If re-encoding is fine, you also can use command below:

ffmpeg -i first.mp3 -i second.mp3 -filter_complex [0:a][1:a]concat=n=2:v=0:a=1 out.mp3