[FFmpeg-user] wav concat woes

Tim Hiles thiles at confex.com
Mon Apr 28 06:49:17 CEST 2014


> > On Fedora 20, trying to concatenate a set of wav files.
> >
> > cat 01_list.txt
> > file '01/01.01_test.wav'
> > file '01/01.02_test.wav'
> > file '01/01.03_test.wav'
> > file '01/01.04_test.wav'
> >
> > ffmpeg  -f concat -i 01_list.txt -vn -c:a libfdk_aac    -profile:a aac_he
> > -b:a 48k -ac 1 -signaling implicit    test2.m4a 2> ffmpeg.out
> > And I can run the command on each individually.
> >..
> >..
> > Any help appreciated.
>
>
I will preface my comment by saying I'm not sure if this breaks ffmpeg
email list rules by suggesting this, so my apologies in advance if I'm not
supposed to.

I used ffmpeg for almost every video encoding and some audio encoding as
well.  Occasionally I will need to use opensource command line software
called sox.  I'm not endorsing, I'm not on their team, nor a friend of
anyone on the team, etc.  Just mentioning another tool to use.

According to the sox documentation you can use example below to concatenate.

sox −m music.mp3 voice.wav mixed.flac

 I just tested it out using this:

 c:\sox\sox.exe "WS520148.WAV" "WS520149.WAV" total.wav


As far as I am aware, conjoining .wav files is not that simple.  While
> cat joins the files together, it doesn't take into
> account the RIFF header at the beginning of each one.  Thus you get a
> combined file that thinks it is only as long
> as the first sample in the list.  You either need a program that can
> join them correctly for you, or you take the headers
> into account when joining them, and adjust the parameters of the
> resulting file accordingly.


I won't dispute what Chris said at all because it maybe be true with ffmpeg
but I did ffprobe on the resulting file I got and got this:

c:\ffmpeg\ffmpeg\bin\ffprobe.exe -i total.wav
ffprobe version N-51683-g9dc88ac Copyright (c) 2007-2013 the FFmpeg
developers
  built on Apr  8 2013 21:19:21 with gcc 4.8.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-avisynth --enable-bzlib --enable-fontconfi
g --enable-frei0r --enable-gnutls --enable-iconv --enable-libass
--enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-li
bopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger
--enable-libsoxr --enable-libspeex --enable-libtheo
ra --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libx264
 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 25.100 / 52. 25.100
  libavcodec     55.  2.100 / 55.  2.100
  libavformat    55.  1.100 / 55.  1.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 49.101 /  3. 49.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[wav @ 020df920] max_analyze_duration 5000000 reached at 5015510
microseconds
Input #0, wav, from 'total.wav':
  Duration: 00:01:07.01, bitrate: 1411 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2
channels, s16, 1411 kb/s

In addition, windows media player and windows explorer gives the correct
time duration of the combined wav files.

Tim


More information about the ffmpeg-user mailing list