HopWorks
HopWorks

Reputation: 468

How to join AAC files with AVCONV CONCAT using an input txt file?

I have a number of AAC files and want to concatenate them into one AAC file. When I do this with AVCONV at the command line and I am specific with the file names, it works. When I try to do this with a text file that holds a list of files, it fails. What led me here is the FFMPEG tutorial page at Concatenating media files. I get a variety of results depending on what I try and I cannot find any info on what I am doing wrong with the syntax.

My file list (list.txt in the same directory)...

file 'sr_program_2015_03_23_05_44_01.aac'
file 'sr_program_2015_03_23_07_44_58.aac'

When I follow the example at the page I mentioned above, I get an error. I included both the use of ffmpeg AND avconv but the results are the same.

ffmpeg...

ffmpeg -f concat -i list.txt -c copy output
ffmpeg version 0.8.17-6:0.8.17-1, Copyright (c) 2000-2014 the Libav developers
  built on Mar 15 2015 17:00:31 with gcc 4.7.2
The ffmpeg program is only provided for script compatibility and will be removed
in a future release. It has been deprecated in the Libav project to allow for
incompatible command line syntax improvements in its replacement called avconv
(see Changelog for details). Please use avconv instead.
Unknown input format: 'concat'

avconv...

avconv -f concat -i list.txt -c copy output
avconv version 0.8.17-6:0.8.17-1, Copyright (c) 2000-2014 the Libav developers
  built on Mar 15 2015 17:00:31 with gcc 4.7.2
Unknown input format: 'concat'

When I remove the "-f" and use the filenames directly, it works. I have no idea why. The resulting file also plays as expected.

avconv -i concat:sr_program_2015_03_23_05_44_01.aac\|sr_program_2015_03_23_07_44_58.aac -c copy output.aac
avconv version 0.8.17-6:0.8.17-1, Copyright (c) 2000-2014 the Libav developers
  built on Mar 15 2015 17:00:31 with gcc 4.7.2
[aac @ 0xcb6cc0] channel element 3.5 is not allocated
[aac @ 0xcb4b20] max_analyze_duration reached
[aac @ 0xcb4b20] Estimating duration from bitrate, this may be inaccurate
Input #0, aac, from 'concat:sr_program_2015_03_23_05_44_01.aac|sr_program_2015_03_23_07_44_58.aac':
  Duration: 01:58:34.29, bitrate: 65 kb/s
    Stream #0.0: Audio: aac, 44100 Hz, stereo, s16, 65 kb/s
Output #0, adts, to 'output.aac':
  Metadata:
    encoder         : Lavf53.21.1
    Stream #0.0: Audio: aac, 44100 Hz, stereo, 65 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press ctrl-c to stop encoding
size=   57148kB time=7315.03 bitrate=  64.0kbits/s
video:0kB audio:57148kB global headers:0kB muxing overhead 0.000000%

Noticing that the working approach does not use the '-f' option, I tried that again with my first attempt and got a completely different error.

avconv concat -i list.txt -c copy output.aac
avconv version 0.8.17-6:0.8.17-1, Copyright (c) 2000-2014 the Libav developers
  built on Mar 15 2015 17:00:31 with gcc 4.7.2
Unable to find a suitable output format for 'concat'

The reason I want to process these 'broken stream' aac files from a file list in a file is because I want to create the list from a script/code and then process it as part of a daily automated process. When the streams have broken, there are numerous files with the same date. When all goes well, there is only one file. It happens every other week or so. I want to automate the fix that I usually do manually. I have already accomplished creating the target file list, ironically, from examples on the same page mentioned above when I became stuck with this odd behavior.

I also want to know what it is I am doing wrong. I see the example I used first everywhere. I have tried this on two different machines running debian but different architectures (arm and x86) and received the same results.

Also, to make sure I had the latest ffmeg, I compiled it on each system using this page... Compile FFmpeg on Ubuntu, Debian, or Mint

Thank you for your time.

Upvotes: 1

Views: 1331

Answers (1)

aergistal
aergistal

Reputation: 31209

You have two versions of ffmpeg installed on your system.

When you enter ffmpeg on the command line the older program gets launched. You can see this in your output:

ffmpeg version 0.8.17-6:0.8.17-1

0.8.17 is an older branch which might not include the concat demuxer.

To make sure you launch the correct version, use the full path to the ffmpeg you compiled yourself in your home directory.

/home/your-user/bin/ffmpeg -f concat ...

If you got the latest snapshot the version should be:

ffmpeg version 2.6.git

Upvotes: 2

Related Questions