37
10
I want to concatenate multiple WAV files into a single WAV file using FFMPEG.
I have used the following command and it generates the required file.
Command:
ffmpeg -f concat -i mylist.txt -c copy output.wav
File :
#mylist.txt
file '1.wav'
file '2.wav'
file '3.wav'
file '4.wav'
But as you can see the problem is that I have to create a text file to specify the list of WAV files to concatenate.
I can do all these tasks, but I would prefer a single command something that looks like
ffmpeg -i 1.wav -i 2.wav -i 3.wav -i 4.wav output.wav
or
ffmpeg -i "concat:1.wav|2.wav|3.wav|4.wav" -c copy output.wav
I have tried these two simple commands but they return just the voice of 1.wav
Please help me write a single command( or correct the above 2 commands ) that achieves the desired result.
Please don't suggest other Media Encoders/Editors, I want to use FFMPEG only, as it is already installed and used at other places.
4Note: Don't customize
[0:0][1:0][2:0][3:0]
to match the number of files. Use that exactly as it says. The only thing you should change is the input files andn=4
. – Keavon – 2015-03-07T22:40:23.5239@Keavon: are you sure? Here ffmpeg (version N-49352-gc46943e x64) complains
Too many inputs specified for the "concat" filter.
when I try to process only 2 inputs with the original code. It works though when I remove[2:0][3:0]
... which makes sense to me since in this case there are no such things as streams2:0
and3:0
... – Bigue Nique – 2016-04-22T19:03:26.9431I agree with @BigueNique. I too ran into the same error and though it feels a little silly, wrote some code to generate the proper sequence given
n
. – Ryan DuVal – 2019-05-12T18:54:37.483