[FFmpeg-user] Concatenate several audio files with FFmpeg, how ?

PyProg PyProg pyprog05 at gmail.com
Fri Oct 19 06:56:07 CEST 2012


2012/10/19 Rodney Baker <rodney.baker at iinet.net.au>:

Hello,

> Try  using -filter_complex with the concat filter, but note - you cannot do
> stream copying with this; you must re-encode.
>
> This is a working example that I used recently to concatenate 2x mp4 files and
> re-encode to flv. You should be able to adjust the parameters accordingly but
> I don't know if it will work with audio only. If it does, you'll need the -vn
> switch to tell it that there is no video stream. The following is on one
> single line:
>
> ffmpeg -i <file_1> -i <file_2> -filter_complex concat=n=2:v=1:a=1 -vcodec flv1
> -b:v 256k -acodec libmp3lame -b:a 128k <out_file>
>
> Someone more familiar with the concat filter and filter_complex can probably
> explain what each section does here. I'm not really sure - I just copied what
> someone else had done.

Thanks, but I have a problem with the command:

angelo at angelo-kubuntu:~$
/home/angelo/ekd_toto/linux_dependances_portables/ffmpeg/ffmpeg -i
"/home/angelo/.ekd_tmp/ekd_angelo/concat_audio/tmp_0_.wav" -i
"/home/angelo/.ekd_tmp/ekd_angelo/concat_audio/tmp_1_.wav" -i
"/home/angelo/.ekd_tmp/ekd_angelo/concat_audio/tmp_2_.wav"
-filter_complex concat=n=3:v=1:a=1 -vn -f wav -y
"/home/angelo/test_concat_audio_ffmpeg.wav"
ffmpeg version N-45086-ged015f6 Copyright (c) 2000-2012 the FFmpeg developers
  built on Oct  6 2012 05:10:52 with gcc 4.6 (Debian 4.6.3-1)
  configuration: --prefix=/root/ffmpeg-static/32bit --arch=x86_32
--extra-cflags='-m32 -I/root/ffmpeg-static/32bit/include -static'
--extra-ldflags='-m32 -L/root/ffmpeg-static/32bit/lib -static'
--extra-libs='-lxml2 -lexpat -lfreetype' --enable-static
--disable-shared --disable-ffserver --disable-doc --enable-bzlib
--enable-zlib --enable-postproc --enable-runtime-cpudetect
--enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis
--enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype
--enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc
--enable-libvo-amrwbenc --enable-version3 --enable-libvpx
  libavutil      51. 73.102 / 51. 73.102
  libavcodec     54. 63.100 / 54. 63.100
  libavformat    54. 29.105 / 54. 29.105
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 19.102 /  3. 19.102
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
[wav @ 0xa90f7a0] max_analyze_duration 5000000 reached at 5013333
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, wav, from '/home/angelo/.ekd_tmp/ekd_angelo/concat_audio/tmp_0_.wav':
  Duration: 00:00:05.76, bitrate: 1536 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz,
stereo, s16, 1536 kb/s
[wav @ 0xa98e2a0] max_analyze_duration 5000000 reached at 5013333
Guessed Channel Layout for  Input Stream #1.0 : stereo
Input #1, wav, from '/home/angelo/.ekd_tmp/ekd_angelo/concat_audio/tmp_1_.wav':
  Duration: 00:04:48.33, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz,
stereo, s16, 1536 kb/s
[wav @ 0xaa20540] max_analyze_duration 5000000 reached at 5013333
Guessed Channel Layout for  Input Stream #2.0 : stereo
Input #2, wav, from '/home/angelo/.ekd_tmp/ekd_angelo/concat_audio/tmp_2_.wav':
  Duration: 00:02:28.24, bitrate: 1536 kb/s
    Stream #2:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz,
stereo, s16, 1536 kb/s
Cannot find a matching stream for unlabeled input pad 0 on filter
Parsed_concat_0

> HTH. YMMV.
> Rodney.

a+

-- 
http://ekd.tuxfamily.org
http://ekdm.wordpress.com
http://glouk.legtux.org/guiescputil
http://lcs.dunois.clg14.ac-caen.fr/~alama/blog
http://www.youtube.com/user/EnKoDeurMixeur
http://lprod.org/wiki/doku.php/video:encodage:avchd_converter


More information about the ffmpeg-user mailing list