ffmpeg与-filter_complex串联

时间:2018-10-16 10:57:52

标签: ffmpeg

我看过几个类似的问题,但对我来说,这些问题都没有帮助。
尝试加入1个性质和分辨率不同的音频和4个视频文件时遇到此错误。

ffmpeg -i 0.mp3 -i 1.mp4 -i 2.mkv -i 3.mkv -i 4.webm \
    -filter_complex [0:a:0][1:v:0][2:v:0][3:v:0][4:v:0]concat=n=5:v=1:a=1[outv][outa] \
    -map "[outv]" -map "[outa]" output.mp4

所有这些都会产生以下错误:

Stream specifier ':a:0' in filtergraph description [0:a:0][1:v:0][2:v:0][3:v:0][4:v:0]concat=n=5:v=1:a=1[outv][outa] matches no streams.

由于不同的分辨率和视频格式,直接串联-i "concat:0.mp3|1.mp4..."也无法正常工作。所有方法的语法均取自official documentation,但这里应该缺少一些我想念的东西。

完整的输出日志:

ffmpeg version 3.4.4-0ubuntu0.18.04.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
  configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, mp3, from 'mp3/10.mp3':
  Metadata:
    album_artist    : artist
    title           : title
    artist          : 10
    album           : 12
    track           : 1
    VideoKind       : 2
    date            : 2009
  Duration: 00:06:00.44, start: 0.025056, bitrate: 64 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 64 kb/s
    Metadata:
      encoder         : LAME3.98r
    Stream #0:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 200x200 [SAR 72:72 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
    Metadata:
      comment         : Cover (front)
Input #1, matroska,webm, from '1.mp4':
  Metadata:
    MINOR_VERSION   : 0
    COMPATIBLE_BRANDS: iso6avc1mp41
    MAJOR_BRAND     : dash
    ENCODER         : Lavf57.83.100
  Duration: 00:01:53.05, start: 0.007000, bitrate: 2292 kb/s
    Stream #1:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn, 48 tbc (default)
    Metadata:
      HANDLER_NAME    : VideoHandler
      DURATION        : 00:01:53.048000000
Input #2, matroska,webm, from '2.mkv':
  Metadata:
    MINOR_VERSION   : 0
    COMPATIBLE_BRANDS: iso6avc1mp41
    MAJOR_BRAND     : dash
    ENCODER         : Lavf57.83.100
  Duration: 00:02:08.09, start: 0.007000, bitrate: 1607 kb/s
    Stream #2:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn, 48 tbc (default)
    Metadata:
      HANDLER_NAME    : VideoHandler
      DURATION        : 00:02:08.090000000
Input #3, matroska,webm, from '3.mkv':
  Metadata:
    MINOR_VERSION   : 0
    COMPATIBLE_BRANDS: iso6avc1mp41
    MAJOR_BRAND     : dash
    ENCODER         : Lavf57.83.100
  Duration: 00:01:37.05, start: 0.007000, bitrate: 3525 kb/s
    Stream #3:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn, 48 tbc (default)
    Metadata:
      HANDLER_NAME    : VideoHandler
      DURATION        : 00:01:37.048000000
Input #4, matroska,webm, from '4.webm':
  Metadata:
    MINOR_VERSION   : 0
    COMPATIBLE_BRANDS: iso6avc1mp41
    MAJOR_BRAND     : dash
    ENCODER         : Lavf57.83.100
  Duration: 00:01:45.13, start: 0.007000, bitrate: 3685 kb/s
    Stream #4:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn, 48 tbc (default)
    Metadata:
      HANDLER_NAME    : VideoHandler
      DURATION        : 00:01:45.131000000
Stream specifier ':a:0' in filtergraph description [0:a:0][1:v:0][2:v:0][3:v:0][4:v:0]concat=n=5:v=1:a=1[outv][outa] matches no streams.

0 个答案:

没有答案