有5张图片,每张图片均为800x800.使用如下命令行进行合成视频:
ffmpeg \
-loop 1 -t 2 -i 1.jpg \
-loop 1 -t 2 -i 2.jpg \
-loop 1 -t 2 -i 3.jpg \
-loop 1 -t 2 -i 4.jpg \
-loop 1 -t 2 -i 5.jpg \
-filter_complex \
"[0:v]scale=720:1280,boxblur=10:5[v0_gblur];\
[1:v]scale=720:1280,boxblur=10:5[v1_gblur];\
[2:v]scale=720:1280,boxblur=10:5[v2_gblur];\
[3:v]scale=720:1280,boxblur=10:5[v3_gblur];\
[4:v]scale=720:1280,boxblur=10:5[v4_gblur];\
[0:v]scale=720:720[v0_scale];\
[1:v]scale=720:720[v1_scale];\
[2:v]scale=720:720[v2_scale];\
[3:v]scale=720:720[v3_scale];\
[4:v]scale=720:720[v4_scale];\
[v0_gblur][v0_scale]overlay=x=0:y=280[v0_overlay];\
[v1_gblur][v1_scale]overlay=x=0:y=280[v1_overlay];\
[v2_gblur][v2_scale]overlay=x=0:y=280[v2_overlay];\
[v3_gblur][v3_scale]overlay=x=0:y=280[v3_overlay];\
[v4_gblur][v4_scale]overlay=x=0:y=280[v4_overlay];\
[v1_overlay][v0_overlay]blend=all_expr='A*(if(gte(T,2),1,T/2))+B*(1-(if(gte(T,2),1,T/2)))'[v0];\
[v2_overlay][v1_overlay]blend=all_expr='A*(if(gte(T,2),1,T/2))+B*(1-(if(gte(T,2),1,T/2)))'[v1]; \
[v3_overlay][v2_overlay]blend=all_expr='A*(if(gte(T,2),1,T/2))+B*(1-(if(gte(T,2),1,T/2)))'[v2]; \
[v4_overlay][v3_overlay]blend=all_expr='A*(if(gte(T,2),1,T/2))+B*(1-(if(gte(T,2),1,T/2)))'[v3]; \
[v0][v1][v2][v3]concat=n=4:v=1:a=0[v]" -map "[v]" out.mp4 -y
出现报错信息如下:
ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers built with Apple LLVM version 10.0.0 (clang-1000.11.45.5) configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 Input #0, image2, from '1.jpg': Duration: 00:00:00.04, start: 0.000000, bitrate: 24617 kb/s Stream #0:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 800x800 [SAR 72:72 DAR 1:1], 25 fps, 25 tbr, 25 tbn, 25 tbc Input #1, image2, from '2.jpg': Duration: 00:00:00.04, start: 0.000000, bitrate: 20739 kb/s Stream #1:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 800x800 [SAR 72:72 DAR 1:1], 25 fps, 25 tbr, 25 tbn, 25 tbc Input #2, image2, from '3.jpg': Duration: 00:00:00.04, start: 0.000000, bitrate: 22104 kb/s Stream #2:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 800x800 [SAR 72:72 DAR 1:1], 25 fps, 25 tbr, 25 tbn, 25 tbc Input #3, image2, from '4.jpg': Duration: 00:00:00.04, start: 0.000000, bitrate: 10545 kb/s Stream #3:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 800x800 [SAR 72:72 DAR 1:1], 25 fps, 25 tbr, 25 tbn, 25 tbc Input #4, image2, from '5.jpg': Duration: 00:00:00.04, start: 0.000000, bitrate: 21817 kb/s Stream #4:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 800x800 [SAR 72:72 DAR 1:1], 25 fps, 25 tbr, 25 tbn, 25 tbc Stream mapping: Stream #0:0 (mjpeg) -> scale Stream #0:0 (mjpeg) -> scale Stream #0:0 (mjpeg) -> blend:bottom Stream #0:0 (mjpeg) -> blend:bottom Stream #0:0 (mjpeg) -> blend:bottom Stream #1:0 (mjpeg) -> scale Stream #1:0 (mjpeg) -> scale Stream #2:0 (mjpeg) -> scale Stream #2:0 (mjpeg) -> scale Stream #3:0 (mjpeg) -> scale Stream #3:0 (mjpeg) -> scale Stream #4:0 (mjpeg) -> scale Stream #4:0 (mjpeg) -> scale concat -> Stream #0:0 (libx264) Press [q] to stop, [?] for help [swscaler @ 0x7fb52f464a00] deprecated pixel format used, make sure you did set range correctly [swscaler @ 0x7fb52f81fc00] deprecated pixel format used, make sure you did set range correctly [swscaler @ 0x7fb531193000] deprecated pixel format used, make sure you did set range correctly [swscaler @ 0x7fb5319bd400] deprecated pixel format used, make sure you did set range correctly [swscaler @ 0x7fb5319ed600] deprecated pixel format used, make sure you did set range correctly [swscaler @ 0x7fb531a22a00] deprecated pixel format used, make sure you did set range correctly [swscaler @ 0x7fb5311be800] deprecated pixel format used, make sure you did set range correctly [Parsed_blend_21 @ 0x7fb52efc0340] First input link top parameters (size 720x1280) do not match the corresponding second input link bottom parameters (size 800x800) [Parsed_blend_21 @ 0x7fb52efc0340] Failed to configure output pad on Parsed_blend_21 Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while processing the decoded data for stream #4:0
|