ChinaFFmpeg

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 6163|回复: 1

ffmpeg如何做模糊背景

[复制链接]
发表于 2019-12-15 15:23:28 | 显示全部楼层 |阅读模式
原视频是720x720的 我想做的效果是视频尺寸是720宽x1280高 中间还是720x720的原视频 上面下面的720宽x280高都是用模糊视频背景填充的 ,请问该如何写代码谢谢
回复

使用道具 举报

发表于 2019-12-15 18:57:28 | 显示全部楼层
[AppleScript] 纯文本查看 复制代码
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.


然后

[AppleScript] 纯文本查看 复制代码
./ffmpeg -i ~/Movies/objectC/facebook.mp4 -filter_complex "[0:v]split=2[v1][v2];[v1]avgblur=sizeX=100:sizeY=100[vb];[v2]scale=640:320[vf];[vb][vf]overlay=x=(H-h)/2" a.mp4
回复 支持 反对

使用道具 举报

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

本版积分规则

手机版|Archiver|ChinaFFmpeg

GMT+8, 2024-12-27 01:45 , Processed in 0.059192 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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