ffmpeg 抛出“输出流中的非单调 DTS”

ffmpeg 抛出“输出流中的非单调 DTS”

所以我尝试连接 3 个视频文件。我正在运行 Linux,命令行如下所示:

ffmpeg -f concat -safe 0 -i blist.txt -c copy output.mp4

blist.txt 包含以下内容:

file 'btest/00 - Test Pattern.mp4'
file 'btest/01 - In Memoriam.mp4'
file 'btest/EndLoop.mp4'

当它开始处理第二个文件时,它会抛出这样的错误,但继续运行:

Non-monotonous DTS in output stream 0:0;

生成的文件长度应为 4:13,但最终长度为 9:57。第一个片段播放完美,但之后全是黑屏,剩下的 4:13 有正确的音频,然后一片寂静。

我知道我需要重新编码所有文件,但我不知道要使用什么参数。

有关每个输入的详细信息ffmpeg

ffmpeg version N-92086-gd702769 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
  configuration: --disable-x86asm
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 31.102 / 58. 31.102
  libavformat    58. 18.103 / 58. 18.103
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.100 /  7. 33.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'upload/00 - Test Pattern.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.40.101
  Duration: 00:02:26.87, start: 0.000000, bitrate: 243 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 106 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'upload/01 - In Memoriam.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.40.101
  Duration: 00:01:32.07, start: 0.000000, bitrate: 219 kb/s
    Stream #1:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 82 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #1:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'upload/99 - End Loop.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.40.101
  Duration: 00:00:15.05, start: 0.000000, bitrate: 236 kb/s
    Stream #2:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 99 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #2:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
At least one output file must be specified

有人可以帮我吗?

答案1

长话短说,经过多次尝试和失败后,有人好心地指导我将格式从 .mp4 更改为 .mkv,效果很好。

使用的确切命令是:

    ffmpeg -i "input/$t.mp4" -c:a copy -c:v copy "output/$o.mkv"

相关内容