ffmpeg - 使用 ffmpeg concat 输出音频流的非单调 DTS

标签 ffmpeg

这是在 FFMPEG - Non-Monotonous DTS on concat 中提出的。但发帖者在没有得到回复后,只是选择了 MP4Box。但是,我想坚持使用我认为更快的 ffmpeg。

我正在连接使用相同编解码器同时编码的 mp4 文件的文本文件列表中的文件,因此文件之间不应该不兼容。

我什至不确定非单调 DTS 是什么(任何人?),但我担心它可能会在连接文件中产生一些故障。它们看起来不错,但声音中有一些人工制品的证据。我可以调整我的命令行来摆脱这个错误,它会加速连接过程吗?
我正在使用 Python 子进程调用,传递给此函数的文件是文件列表。函数装饰器只是一个用于分析的计时器函数。
我已经用我的系统 ffmpeg 尝试过这个,而不仅仅是静态构建,它也有同样的问题。

@fn_timer
def concat(file):
    proc = call(['/opt/jane_ng/jane_nodejs/ffmpeg-git-20150308-64bit-static/ffmpeg', '-f', 'concat', '-i', file, '-c', 'copy', '-y', 'testConcat.mp4'])

当我运行它时,我得到以下输出:

ffmpeg version N-45007-g9d7e42e-   http://johnvansickle.com/ffmpeg/    Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --cc=gcc-4.9
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 12.100 /  5. 12.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[concat @ 0x31bdd80] Could not find codec parameters for stream 2 (Unknown: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, concat, from '/opt/combinatoria/generator/concatFiles/concat.txt':
  Duration: N/A, start: 0.000000, bitrate: 1625 kb/s
    Stream #0:0: Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 960x540 [SAR 1:1 DAR 16:9], 1561 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1: Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s
    Stream #0:2: Unknown: none
Output #0, mp4, to 'testConcat.mp4':
  Metadata:
    encoder         : Lavf56.25.101
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 960x540 [SAR 1:1 DAR 16:9], q=2-31, 1561 kb/s, 25 fps, 25 tbr, 90k tbn, 90k tbc
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 64 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 253952, current: 250488; changing to 253953. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 253953, current: 252536; changing to 253954. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 754296, current: 751464; changing to 754297. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 754297, current: 753512; changing to 754298. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 974696, current: 971964; changing to 974697. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 974697, current: 974012; changing to 974698. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 1340604, current: 1337112; changing to 1340605. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 1340605, current: 1339160; changing to 1340606. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 1746712, current: 1742832; changing to 1746713. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 1746713, current: 1744880; changing to 1746714. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 2119664, current: 2116800; changing to 2119665. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 2119665, current: 2118848; changing to 2119666. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 2274496, current: 2272032; changing to 2274497. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 2274497, current: 2274080; changing to 2274498. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 2685728, current: 2683044; changing to 2685729. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 2685729, current: 2685092; changing to 2685730. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 2850980, current: 2847096; changing to 2850981. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 2850981, current: 2849144; changing to 2850982. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 3033464, current: 3030552; changing to 3033465. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 3033465, current: 3032600; changing to 3033466. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 3384856, current: 3381588; changing to 3384857. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 3384857, current: 3383636; changing to 3384858. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 3760468, current: 3757320; changing to 3760469. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 3760469, current: 3759368; changing to 3760470. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 3990792, current: 3988404; changing to 3990793. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 3990793, current: 3990452; changing to 3990794. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 4295604, current: 4291812; changing to 4295605. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 4295605, current: 4293860; changing to 4295606. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 4750564, current: 4746924; changing to 4750565. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 4750565, current: 4748972; changing to 4750566. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 5025452, current: 5022108; changing to 5025453. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 5025453, current: 5024156; changing to 5025454. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 5271964, current: 5269068; changing to 5271965. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 5271965, current: 5271116; changing to 5271966. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 5707340, current: 5704776; changing to 5707341. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 5707341, current: 5706824; changing to 5707342. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 6003784, current: 6001128; changing to 6003785. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 6003785, current: 6003176; changing to 6003786. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 6371816, current: 6368040; changing to 6371817. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 6371817, current: 6370088; changing to 6371818. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 6875944, current: 6872544; changing to 6875945. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 6875945, current: 6874592; changing to 6875946. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 7042528, current: 7040124; changing to 7042529. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 7042529, current: 7042172; changing to 7042530. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 7314556, current: 7311780; changing to 7314557. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 7314557, current: 7313828; changing to 7314558. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 7541156, current: 7537572; changing to 7541157. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 7541157, current: 7539620; changing to 7541158. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 7795620, current: 7791588; changing to 7795621. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 7795621, current: 7793636; changing to 7795622. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 8063972, current: 8059716; changing to 8063973. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 8063973, current: 8061764; changing to 8063974. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 8063974, current: 8063812; changing to 8063975. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 8350532, current: 8347248; changing to 8350533. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 8350533, current: 8349296; changing to 8350534. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 8656496, current: 8652420; changing to 8656497. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 8656497, current: 8654468; changing to 8656498. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 8902276, current: 8899380; changing to 8902277. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 8902277, current: 8901428; changing to 8902278. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 9159476, current: 9156924; changing to 9159477. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 9159477, current: 9158972; changing to 9159478. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 9468220, current: 9465624; changing to 9468221. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 9468221, current: 9467672; changing to 9468222. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 9748248, current: 9744336; changing to 9748249. This may result in incorrect timestamps in the output file.
[mp4 @ 0x3255080] Non-monotonous DTS in output stream 0:1; previous: 9748249, current: 9746384; changing to 9748250. This may result in incorrect timestamps in the output file.
frame= 5637 fps=0.0 q=-1.0 Lsize=   45617kB time=00:03:45.60 bitrate=1656.4kbits/s    
video:43701kB audio:1792kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.272048%
Total time running concat: 0.451297044754 seconds


这个过程绝对是我当前项目的关键,所以任何帮助或澄清将不胜感激。

最佳答案

最终,一旦我重新编码了我输入 ffmpeg concat 命令的源文件,它就可以正常工作并流式传输。处理时没有 DTS 错误,并且它与来自服务器的音频同步流式传输。

关于ffmpeg - 使用 ffmpeg concat 输出音频流的非单调 DTS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30241572/

相关文章:

python - 无法保存matplotlib动画

c# - 如何从 mp4 FileStream 对象中提取持续时间(不存储在文件系统中)

c++ - 如何使用 FFMPEG 从编码视频中提取 AVPacket 的重要信息

audio - 从文件中的 AVSubtitle 转储字幕

audio - 如何将 aac 转换为 ogg opus 保持比特率和采样率不变

android - 如何将DJI H264 FPV Feed读取为OpenCV Mat对象?

ffmpeg 记录 16 位,即使我只想要 8 位

ssl - FFplay key 文件和证书默认路径

c++ - FFMPEG 并将 swf 转换为图像?

windows - 为输出文件分配日期和时间