ChinaFFmpeg

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 7221|回复: 5

[Linux] 滤镜blend使用问题

[复制链接]
发表于 2019-9-25 10:31:10 | 显示全部楼层 |阅读模式
有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

回复

使用道具 举报

 楼主| 发表于 2019-9-25 10:59:44 | 显示全部楼层
按道理输入到blend的top和bottom都为720x1280。但为什么bottom却为800x800?
回复 支持 反对

使用道具 举报

发表于 2019-9-25 13:44:31 | 显示全部楼层
参考一下这个,可能有帮助
游客,如果您要查看本帖隐藏内容请回复

回复 支持 反对

使用道具 举报

发表于 2019-10-12 16:06:02 | 显示全部楼层
kankan
回复

使用道具 举报

发表于 2019-11-19 10:41:27 | 显示全部楼层
看看
回复

使用道具 举报

发表于 2019-11-20 11:18:21 | 显示全部楼层
看看,学习一下
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|Archiver|ChinaFFmpeg

GMT+8, 2024-4-24 05:42 , Processed in 0.049615 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表