ffmpeg command for concatenate two mp3 files
To skip re-encoding, use the concat demuxer:
Create a text file
file '/path/to/first.mp3'
file '/path/to/second.mp3'
and then
ffmpeg -f concat -i list.txt -c copy out.mp3
If re-encoding is fine,
ffmpeg -i first.mp3 -i second.mp3 -filter_complex [0:a][1:a]concat=n=2:v=0:a=1 out.mp3
Usually,
cat first.mp3 second.mp3 > out.mp3
should just work. You didn't say what goes wrong when you try it.
Alternatively, you can use mp3wrap
:
mp3wrap out.mp3 first.mp3 second.mp3 third.mp3 ...
This doesn't re-encode the MP3s like ffmpeg
would, it keeps the ID3 tags, and you can split the files again later with mp3split
.
I advise against using ffmpeg
or similar programs, because reencoding causes loss of quality.
you could also use cat [your files] > concat.mp3
which will produce a mp3 file that has multiple headers and ID3 tags. Afterwards you can correct this by invoking mp3val -f -nb concat.mp3
.