如何使用输入的 txt 文件将 AAC 文件与 AVCONV CONCAT 连接起来?

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

我有许多 AAC 文件,想将它们合并成一个 AAC 文件。当我在命令行中使用 AVCONV 执行此操作并且我指定了文件名时,它就可以工作了。当我尝试使用包含文件列表的文本文件执行此操作时,它失败了。让我来到这里的是位于 Concatenating media files 的 FFMPEG 教程页面。根据我的尝试,我得到了各种各样的结果,但我找不到任何关于我在语法上做错了什么的信息。

我的文件列表(list.txt在同一目录)...

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

当我按照上面提到的页面中的示例进行操作时,出现错误。我包括了 ffmpeg 和 avconv 的使用,但结果是一样的。

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'

当我删除“-f”并直接使用文件名时,它起作用了。我不知道为什么。生成的文件也按预期播放。

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%

注意到工作方法不使用“-f”选项,我在第一次尝试时再次尝试并得到一个完全不同的错误。

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'

我想从文件中的文件列表中处理这些 'broken stream' aac 文件的原因是因为我想从 script/code 创建列表,然后将其作为日常处理的一部分进行处理自动化过程。当流中断时,有许多文件具有相同的日期。一切顺利时,只有一个文件。它每隔一周左右发生一次。我想自动执行我通常手动执行的修复。具有讽刺意味的是,当我陷入这种奇怪的行为时,我已经根据上述同一页面上的示例完成了目标文件列表的创建。

我也想知道我做错了什么。我到处都看到我首先使用的例子。我已经在两台不同的机器 运行 debian 但不同的架构(arm 和 x86)上尝试过,并收到相同的结果。

此外,为了确保我拥有最新的 ffmeg,我使用此页面在每个系统上编译它...Compile FFmpeg on Ubuntu, Debian, or Mint

感谢您的宝贵时间。

您的系统上安装了 ffmpeg 的两个版本

当您在命令行中输入 ffmpeg 时,旧程序将启动。您可以在输出中看到:

ffmpeg version 0.8.17-6:0.8.17-1

0.8.17 是一个较旧的分支,可能不包括 concat 分离器。

为确保启动正确的版本,请使用 ffmpeg 你在自己的主目录中编译了自己。

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

如果你有最新的快照版本应该是:

ffmpeg version 2.6.git