hellohexiang 发表于 2019-12-15 15:23:28

ffmpeg如何做模糊背景

原视频是720x720的 我想做的效果是视频尺寸是720宽x1280高 中间还是720x720的原视频 上面下面的720宽x280高都是用模糊视频背景填充的 ,请问该如何写代码谢谢

孙悟空 发表于 2019-12-15 18:57:28

StevenLiu:su StevenLiu$ ffmpeg -h filter=avgblur
ffmpeg version N-94165-g6e988b75df Copyright (c) 2000-2019 the FFmpeg developers
built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
configuration: --enable-libass --enable-opengl --enable-libx264 --enable-libmp3lame --enable-gpl --enable-nonfree --prefix=/usr/local --enable-libtesseract --enable-libspeex --enable-libfreetype --enable-libfontconfig --enable-libfdk-aac --enable-videotoolbox --enable-libxml2 --enable-librsvg --enable-libvmaf --enable-version3 --disable-stripping --disable-optimizations
libavutil      56. 30.100 / 56. 30.100
libavcodec   58. 53.101 / 58. 53.101
libavformat    58. 28.101 / 58. 28.101
libavdevice    58.7.100 / 58.7.100
libavfilter   7. 56.100 /7. 56.100
libswscale      5.4.101 /5.4.101
libswresample   3.4.100 /3.4.100
libpostproc    55.4.100 / 55.4.100
Filter avgblur
Apply Average Blur filter.
    slice threading supported
    Inputs:
       #0: default (video)
    Outputs:
       #0: default (video)
avgblur AVOptions:
sizeX             <int>      ..FV..... set horizontal size (from 1 to 1024) (default 1)
planes            <int>      ..FV..... set planes to filter (from 0 to 15) (default 15)
sizeY             <int>      ..FV..... set vertical size (from 0 to 1024) (default 0)

This filter has support for timeline through the 'enable' option.

然后

./ffmpeg -i ~/Movies/objectC/facebook.mp4 -filter_complex "split=2;avgblur=sizeX=100:sizeY=100;scale=640:320;overlay=x=(H-h)/2" a.mp4
页: [1]
查看完整版本: ffmpeg如何做模糊背景