This will concatenate two mp3 files, and the resulting metadata will be that of the first file:
ffmpeg -i "concat:file1.mp3|file2.mp3" -acodec copy output.mp3
This is because, for ffmpeg, the whole "concat:" part is a single "input file", and its metadata will be of the first concatenated file. If you want to use metadata from the second file instead, you have to add it as a dummy input file and map its metadata to that of the output:
ffmpeg -i "concat:file1.mp3|file2.mp3" -i file2.mp3 -acodec copy test.mp3 -map_metadata 0:1
If you want to construct your metadata from the two metadatas, you'll have to do it by hand. You can dump a file's metadata with
ffmpeg -i file1.mp3 -f ffmetadata file1.metadata
After dumping both metadatas and constructing new metadata, you can add it to the output file with -metadata
, and you can disable metadata copying by setting a -map_metadata
mapping from a negative input file number. This sets a name value and no other metadata:
ffmpeg -i "concat:file1.mp3|file2.mp3" -acodec copy -metadata "title=Some Song" test.mp3 -map_metadata 0:-1
cat
helped me to join corrupted mp3 files.