【问题标题】:Non-monotonous DTS in output stream when concat videos using ffmpeg使用 ffmpeg 连接视频时输出流中的非单调 DTS
【发布时间】:2018-07-19 03:54:13
【问题描述】:

我有三个视频,我想将它们连接在一起问题它适用于某些视频但当我测试特定视频时它给我一个错误并导致生成的视频以一种奇怪的方式显示并且一切都进展得非常快在视频中,就像我转发视频一样
这是我用来从 out.txt 文件中添加视频的代码

file 'D:/Build/start.mp4'
file 'D:/Build/a.mp4'
file 'D:/Build/Song & Lyrics/2f.mp4'

我在 ffmpeg 中使用的命令

ffmpeg -f concat -safe 0 -i out.txt -c copy -y go.mp4

我遇到了这个错误

    [mov,mp4,m4a,3gp,3g2,mj2 @ 05c0dbc0] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'out.txt':
  Duration: N/A, start: 0.000000, bitrate: 280 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 155 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Metadata:
      creation_time   : 2018-02-08T13:25:49.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 02/08/2018.
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s
    Metadata:
      creation_time   : 2018-02-08T13:25:49.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 02/08/2018.
Output #0, mp4, to 'go.mp4':
  Metadata:
    encoder         : Lavf58.7.100
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 155 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc
    Metadata:
      creation_time   : 2018-02-08T13:25:49.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 02/08/2018.
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s
    Metadata:
      creation_time   : 2018-02-08T13:25:49.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 02/08/2018.
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 05c38840] Auto-inserting h264_mp4toannexb bitstream filter
[mp4 @ 061b8f00] Non-monotonous DTS in output stream 0:0; previous: 624624, current: 88735; changing to 624625. This may result in incorrect timestamps in the output file.
[mp4 @ 061b8f00] Non-monotonous DTS in output stream 0:0; previous: 624625, current: 89247; changing to 624626. This may result in incorrect timestamps in the output file.
[mp4 @ 061b8f00] Non-monotonous DTS in output stream 0:0; previous: 624626, current: 89759; changing to 624627. This may result in incorrect timestamps in the output file.
.....

[mov,mp4,m4a,3gp,3g2,mj2 @ 05c38840] Auto-inserting h264_mp4toannexb   bitstream filtereed=69.7x
frame= 8991 fps=2903 q=-1.0 Lsize=    8378kB time=00:05:58.22 bitrate= 191.6kbits/s speed= 116x
video:2469kB audio:5625kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.500685%

那么是什么问题导致了这个错误。当我使用这个新的 start.mp4 与我在其他视频上尝试过的视频合并时出现问题。
更新
我测试将视频转换为 MTS 格式,然后将它们连接为类似问题的答案,但问题是当我将 mp4 视频转换为这种格式时,文件的大小从 6 MB 到 42 MB 太大!所以如果有更好的答案。或使文件大小保持不变或更小的方法 答案的链接是here,但效果很好 在此先感谢

【问题讨论】:

  • 我意识到这是旧的,并且已经有了答案(与 OP 相同)。这根本不是编程问题。
  • 我知道它不是 :),我标记了视频和 ffmpeg,我认为这个问题很清楚,一个 ffmpeg 问题是的,关闭它,很长时间了:D

标签: video ffmpeg


【解决方案1】:

这次我尝试解决问题并进行一些搜索,我注意到第一个视频与我之前测试的其他视频的帧/秒不同,我使用此命令使它们都具有 25帧/秒

FFmpeg -y -i source.mp4 -r 25 -s 160x90 -c:v libx264 -b:v 3M -strict -2 -movflags fast start destination.mp4

当我开始添加它输出的输出视频时,此命令使所有视频具有相同的帧/秒和分辨率,没有任何问题,因此我需要确认此信息是否正确,因为我不确定。但它对我有用

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-09-18
    • 1970-01-01
    • 1970-01-01
    • 2023-03-17
    • 1970-01-01
    • 2020-09-23
    • 2022-01-24
    • 1970-01-01
    相关资源
    最近更新 更多