1

I have a code for concatenation of files using ffmpeg.Here silence.wav is a mute audio file with 2 seconds length. I need to prepend this mut audio file to REC00096_Jun-06-2014 16.47.28.wav. I tried the folowing code.

ffmpeg -i D:\vishnu\silence.wav -i D:\vishnu\REC00096_Jun-06-2014 16.47.28.wav \-filter_complex '[0:0][1:0][2:0][3:0]concat=n=2:v=0:a=1[out]' \-map '[out]' output.wav

Following is the error i am getting.

     D:\vishnu>ffmpeg -i silence.wav -i "D:\vishnu\REC00096_Jun-06-2014 16.47.28.wav"
 -filter_complex '[0:0][1:0]concat=n=2:v=0:a=1[out]' -map '[out]' output.wav
ffmpeg version N-59036-g5d8e4f6 Copyright (c) 2000-2013 the FFmpeg developers
  built on Dec 12 2013 22:01:01 with gcc 4.8.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aa
cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavp
ack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 58.100 / 52. 58.100
  libavcodec     55. 45.101 / 55. 45.101
  libavformat    55. 22.100 / 55. 22.100
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     3. 92.100 /  3. 92.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, wav, from 'silence.wav':
  Metadata:
    encoder         : Lavf55.22.100
  Duration: 00:00:02.02, bitrate: 4234 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 5.1, s16, 4
233 kb/s
Guessed Channel Layout for  Input Stream #1.0 : mono
Input #1, wav, from 'D:\vishnu\REC00096_Jun-06-2014 16.47.28.wav':
  Duration: 00:00:08.04, bitrate: 384 kb/s
    Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 24000 Hz, mono, s16,
384 kb/s
[wav @ 02755e40] Invalid stream specifier: '[out]'.
    Last message repeated 1 times
Stream map ''[out]'' matches no streams.

D:\vishnu>

1 Answer 1

1

You have a backslash in there at \-filter_complex. I have no idea where that comes from, but you should just write -filter_complex instead. Same goes for -map.

Perhaps you've been trying to copy-paste a multi-line Bash script, where newlines are escaped with a backslash, e.g. if someone gave you this Bash script:

ffmpeg -i silence.wav -i "REC00096_Jun-06-2014 16.47.28.wav" \
-filter_complex "[0:0][1:0]concat=n=2:v=0:a=1[out]" \
-map "[out]" output.wav

Then you should translate it to:

ffmpeg -i silence.wav -i "REC00096_Jun-06-2014 16.47.28.wav" -filter_complex "[0:0][1:0]concat=n=2:v=0:a=1[out]" -map "[out]" output.wav

Also note that you only need [0:0] and [1:0]. There is no third and fourth input file.

5
  • Tried the mentioned code. Not working. I edited the command line output. Commented Jun 11, 2014 at 8:13
  • See my updated answer. You need to remove [2:0] and [3:0] because you only have two inputs. Commented Jun 11, 2014 at 9:20
  • Tried the updated answer. Not working. I again edited the cmd.line output Commented Jun 11, 2014 at 9:29
  • 1
    Works for me. Maybe you need double quotes instead of single quotes? This seems like a Windows thing. Commented Jun 11, 2014 at 10:36
  • Yes I am using windows.Worked fine. Commented Jun 12, 2014 at 8:24

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.