php - How to join several mp3s (wavs) on server? -
i'm looking possibility join several audio files in 1 on server.
example: audio_01.mp3 / 33sec + audio_02.mp3 / 22sec = audio_03.mp3 / 55sec
server - linux based, main language php (just in case)
could please point me in right direction?
thanks in advance!
using ffmpeg
this concatenate 2 mp3 files, , resulting metadata of first file:
ffmpeg -i "concat:file1.mp3|file2.mp3" -acodec copy output.mp3
this because, ffmpeg, whole "concat:" part single "input file", , metadata of first concatenated file. if want use metadata second file instead, have add dummy input file , map metadata of output:
ffmpeg -i "concat:file1.mp3|file2.mp3" -i file2.mp3 -acodec copy test.mp3 -map_metadata 0:1
if want construct metadata 2 metadatas, you'll have hand. can dump file's metadata with
ffmpeg -i file1.mp3 -f ffmetadata file1.metadata
after dumping both metadatas , constructing new metadata, can add output file -metadata, , can disable metadata copying setting -map_metadata mapping negative input file number. sets name value , no other metadata:
ffmpeg -i "concat:file1.mp3|file2.mp3" -acodec copy -metadata "title=some song" test.mp3 -map_metadata 0:-1
Comments
Post a Comment