gpt4 book ai didi

audio - FFMpeg 串联过滤器 : Stream specifier ':0' in filtergraph matches no streams

转载 作者:行者123 更新时间:2023-12-04 01:39:53 34 4
gpt4 key购买 nike

我正在开发一个严重依赖 FFMpeg 对音频文件执行各种转换的应用程序。我目前正在命令行上测试我的 FFMpeg 配置。

我正在尝试连接多个不同格式的音频文件(主要是 MP3、MP2 和 WAV)。我一直在使用官方的 TRAC 文档(https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20(join%2C%20merge)%20media%20files#differentcodec)来帮助我解决这个问题,并创建了以下命令:

ffmpeg -i OHIn.wav -i OHOut.wav -filter_complex '[0:0] [1:0] concat=n=2:a=1 [a]' -map '[a]' output.wav

但是,当我使用 FFMpeg 2.0.1 版在 Mac OS X 上运行它时,我收到以下错误消息:
Stream specifier ':0' in filtergraph description [0:0] [1:0] concat=n=2:a=1 [a] matches no streams.

这是我从终端的完整输出:
~/ffmpeg -i OHIn.wav -i OHOut.wav -filter_complex '[0:0] [1:0] concat=n=2:a=1 [a]' -map '[a]' output.wav

ffmpeg version 2.0.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Aug 15 2013 10:56:46 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --arch=x86_64 --enable-runtime-cpudetect
libavutil 52. 38.100 / 52. 38.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.100 / 55. 12.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 79.101 / 3. 79.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'OHIn.wav':
Duration: 00:00:06.71, bitrate: 1411 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, wav, from 'OHOut.wav':
Duration: 00:00:07.19, bitrate: 1411 kb/s
Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Stream specifier ':0' in filtergraph description [0:0] [1:0] concat=n=2:a=1 [a] matches no streams.

我不明白为什么这不起作用。 FFMpeg 显示流 0:0 和 1:0 存在于源文件中。网上唯一的其他类似问题围绕着在 Windows 中使用单引号,但是对此的测试确认它不适用于我的 Mac 命令行。

任何帮助将非常感激。

最佳答案

你需要告诉concat过滤输出视频流的数量。默认为 v=1用于视频和 a=0用于音频,但您没有视频流。最好不要依赖默认值。手动列出输入段数(n)、输出视频流(v)和输出音频流(a)。

ffmpeg -i input0.wav -i input1.wav -filter_complex "[0:a][1:a]concat=n=2:v=0:a=1[a]" -map "[a]" output.wav

请注意,我添加了 v=0 .

concat filter documentation了解更多信息。

关于audio - FFMpeg 串联过滤器 : Stream specifier ':0' in filtergraph matches no streams,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19417412/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com