ffmpeg 无效的流说明符:si

ffmpeg Invalid stream specifier: si

我正在尝试运行以下命令:

    -i "2020_11_30_03_37_37.mp4" -i "2020_11_30_03_37_44.jpg" -f lavfi -t 6.016 -i anullsrc -filter_complex "[0:v]crop=544:544:0:208,boxblur=luma_radius=10:chroma_radius=10:luma_power=1,scale=1080:1080[bg];[0:v]scale=612:1080[fg];[bg][fg]overlay=234:0:shortest=1[si];[si]trim=0:1,setpts=(PTS-STARTPTS)*2[video0];[0:a]atrim=0:1,asetpts=PTS-STARTPTS,atempo=0.5[audio0];[si]trim=1:5.016,setpts=(PTS-STARTPTS)*1[video1];[0:a]atrim=1:5.016,asetpts=PTS-STARTPTS,atempo=1[audio1];[video0][audio0][video1][audio1]concat=n=2:v=1:a=1[mv];[1:v]scale=428:-1[sticker1];[mv][sticker1]overlay=x=0:y=0:enable='between(t,0,1)'" "2020_11_30_03_37_50.mp4"

但 FFmpeg 抛出以下错误:

Invalid stream specifier: si.

但我已经在命令中指定了这个流。无法理解哪里出了问题

这是日志

C:\Users\abhis\AppData\Local\Packages815ZMobileApps.VideoDownloaderforYouTubeDownload_61cxy7b35vdsg\TempState>ffmpeg -i "2020_11_30_03_37_37.mp4" -i "2020_11_30_03_37_44.jpg" -f lavfi -t 6.016 -i anullsrc -filter_complex "[0:v]crop=544:544:0:208,boxblur=luma_radius=10:chroma_radius=10:luma_power=1,scale=1080:1080[bg];[0:v]scale=612:1080[fg];[bg][fg]overlay=234:0:shortest=1[si];[si]trim=0:1,setpts=(PTS-STARTPTS)*2[video0];[0:a]atrim=0:1,asetpts=PTS-STARTPTS,atempo=0.5[audio0];[si]trim=1:5.016,setpts=(PTS-STARTPTS)*1[video1];[0:a]atrim=1:5.016,asetpts=PTS-STARTPTS,atempo=1[audio1];[video0][audio0][video1][audio1]concat=n=2:v=1:a=1[mv];[1:v]scale=428:-1[sticker1];[mv][sticker1]overlay=x=0:y=0:enable='between(t,0,1)'" "2020_11_30_03_37_50.mp4"
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10.2.1 (GCC) 20200726
  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-libsrt --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-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2020_11_30_03_37_37.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.45.100
  Duration: 00:00:05.02, start: 0.000000, bitrate: 2097 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 544x960, 1997 kb/s, SAR 1:1 DAR 17:30, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      handler_name    : VideoHandle
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      handler_name    : SoundHandle
Input #1, image2, from '2020_11_30_03_37_44.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 2416762 kb/s
    Stream #1:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1280x854 [SAR 200:200 DAR 640:427], 25 tbr, 25 tbn, 25 tbc
Input #2, lavfi, from 'anullsrc':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #2:0: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000279fa82eb80] Invalid stream specifier: si.
    Last message repeated 1 times
Stream specifier 'si' in filtergraph description [0:v]crop=544:544:0:208,boxblur=luma_radius=10:chroma_radius=10:luma_power=1,scale=1080:1080[bg];[0:v]scale=612:1080[fg];[bg][fg]overlay=234:0:shortest=1[si];[si]trim=0:1,setpts=(PTS-STARTPTS)*2[video0];[0:a]atrim=0:1,asetpts=PTS-STARTPTS,atempo=0.5[audio0];[si]trim=1:5.016,setpts=(PTS-STARTPTS)*1[video1];[0:a]atrim=1:5.016,asetpts=PTS-STARTPTS,atempo=1[audio1];[video0][audio0][video1][audio1]concat=n=2:v=1:a=1[mv];[1:v]scale=428:-1[sticker1];[mv][sticker1]overlay=x=0:y=0:enable='between(t,0,1)' matches no streams.

您不能重复使用过滤器输出中的标签(a.k.a。“pads”,不直观)。所以你不能多次使用 si

添加split filter进行复制:

-i "2020_11_30_03_37_37.mp4" -i "2020_11_30_03_37_44.jpg" -f lavfi -t 6.016 -i anullsrc -filter_complex "[0:v]crop=544:544:0:208,boxblur=luma_radius=10:chroma_radius=10:luma_power=1,scale=1080:1080[bg];[0:v]scale=612:1080[fg];[bg][fg]overlay=234:0:shortest=1,split=outputs=2[si1][si2];[si1]trim=0:1,setpts=(PTS-STARTPTS)*2[video0];[0:a]atrim=0:1,asetpts=PTS-STARTPTS,atempo=0.5[audio0];[si2]trim=1:5.016,setpts=(PTS-STARTPTS)*1[video1];[0:a]atrim=1:5.016,asetpts=PTS-STARTPTS,atempo=1[audio1];[video0][audio0][video1][audio1]concat=n=2:v=1:a=1[mv];[1:v]scale=428:-1[sticker1];[mv][sticker1]overlay=x=0:y=0:enable='between(t,0,1)'" "2020_11_30_03_37_50.mp4"