串联多个mp4文件

时间:2019-10-15 09:15:45

标签: video ffmpeg mp4

我目前正在尝试将多个mp4视频文件合并到一个文件中,我找到了ffmpeg库,并研究了如何使用它的许多方法。 目前,我正在使用ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4

这应该可以,但是由于某种原因它不起作用。我的终端机充满了

(不能提供更多输出)

[mp4 @ 000002ce260bc180] Non-monotonous DTS in output stream 0:0; previous: 24541175, current: 5482875; changing to 24541176. This may result in incorrect timestamps in the output file.
[mp4 @ 000002ce260bc180] Non-monotonous DTS in output stream 0:0; previous: 24541176, current: 5483397; changing to 24541177. This may result in incorrect timestamps in the output file.
[mp4 @ 000002ce260bc180] Non-monotonous DTS in output stream 0:0; previous: 24541177, current: 5483904; changing to 24541178. This may result in incorrect timestamps in the output file.
[mp4 @ 000002ce260bc180] Non-monotonous DTS in output stream 0:0; previous: 24541178, current: 5484426; changing to 24541179. This may result in incorrect timestamps in the output file.
frame=19167 fps=4682 q=-1.0 Lsize=  249689kB time=00:26:37.73 bitrate=1280.2kbits/s speed= 390x
video:243606kB audio:5584kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.200045%

Mylist.txt

file 'ab.mp4'
file 'bb.mp4'
file 'cc.mp4'
file 'dd.mp4'
file 'ee.mp4'
file 'ff.mp4'
file 'gg.mp4'
file 'hh.mp4'
file 'jj.mp4'
file 'kk.mp4'

有关每个输入的信息:

ffmpeg version git-2019-10-13-4f4334b Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20191010
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 59.102 / 58. 59.102
  libavformat    58. 33.100 / 58. 33.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 62.100 /  7. 62.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'ab.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:26.59, start: 0.000000, bitrate: 4610 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1280x720, 4466 kb/s, 60.04 fps, 60 tbr, 15360 tbn, 2k tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'bb.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:40.77, start: 0.000000, bitrate: 3384 kb/s
    Stream #1:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080, 3251 kb/s, 29.99 fps, 29.97 tbr, 15360 tbn, 2k tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #1:1(und): 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 'cc.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:06.29, start: 0.000000, bitrate: 8029 kb/s
    Stream #2:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1600x900, 7896 kb/s, 60.16 fps, 60 tbr, 15360 tbn, 2k tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #2:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from 'dd.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:50.90, start: 0.000000, bitrate: 7851 kb/s
    Stream #3:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuvj420p(pc, unknown/bt709/unknown), 1920x1080, 7708 kb/s, 60.02 fps, 60 tbr, 15360 tbn, 2k tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #3:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #4, mov,mp4,m4a,3gp,3g2,mj2, from 'ee.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:27.10, start: 0.000000, bitrate: 6056 kb/s
    Stream #4:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080, 5912 kb/s, 60.03 fps, 60 tbr, 15360 tbn, 2k tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #4:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #5, mov,mp4,m4a,3gp,3g2,mj2, from 'ff.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:31.00, start: 0.000000, bitrate: 6290 kb/s
    Stream #5:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080, 6150 kb/s, 60.03 fps, 60 tbr, 15360 tbn, 2k tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #5:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #6, mov,mp4,m4a,3gp,3g2,mj2, from 'gg.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:01:00.00, start: 0.000000, bitrate: 4531 kb/s
    Stream #6:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1280x720, 4387 kb/s, 60.02 fps, 60 tbr, 15360 tbn, 2k tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #6:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #7, mov,mp4,m4a,3gp,3g2,mj2, from 'hh.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.20.100
  Duration: 00:00:30.00, start: 0.000000, bitrate: 8186 kb/s
    Stream #7:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080, 8046 kb/s, 60 fps, 60 tbr, 90k tbn, 120 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #7:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #8, mov,mp4,m4a,3gp,3g2,mj2, from 'jj.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:49.81, start: 0.000000, bitrate: 5579 kb/s
    Stream #8:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 1600x900, 5437 kb/s, 60.02 fps, 60 tbr, 15360 tbn, 2k tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #8:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #9, mov,mp4,m4a,3gp,3g2,mj2, from 'kk.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:34.69, start: 0.000000, bitrate: 5223 kb/s
    Stream #9:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080, 5088 kb/s, 30.03 fps, 30 tbr, 15360 tbn, 2k tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #9:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
At least one output file must be specified

我已经阅读了有关ffmpeg导致其他人出现此问题的大多数文章,但没有任何解释的修复程序对我有用。 对于第一个视频,我得到的视频输出似乎还不错,但是一旦过渡到其他视频,它就会“冻结”或将速度设置为100倍左右。输出视频最终也将是28分钟而不是2.8分钟。 有人可以帮助我吗?

0 个答案:

没有答案