ffmpeg视频滤镜:均值模糊-boxblur

滤镜简述

boxblur

官网链接=> https://ffmpeg.org/ffmpeg-filters.html#boxblur

这个滤镜会使图片或者视频变得模糊,他可以针对色度和亮度进行模糊。

滤镜的使用

参数
复制代码
boxblur AVOptions:
   luma_radius       <string>     ..FV....... Radius of the luma blurring box (default "2")
   lr                <string>     ..FV....... Radius of the luma blurring box (default "2")
   luma_power        <int>        ..FV....... How many times should the boxblur be applied to luma (from 0 to INT_MAX) (default 2)
   lp                <int>        ..FV....... How many times should the boxblur be applied to luma (from 0 to INT_MAX) (default 2)
   chroma_radius     <string>     ..FV....... Radius of the chroma blurring box
   cr                <string>     ..FV....... Radius of the chroma blurring box
   chroma_power      <int>        ..FV....... How many times should the boxblur be applied to chroma (from -1 to INT_MAX) (default -1)
   cp                <int>        ..FV....... How many times should the boxblur be applied to chroma (from -1 to INT_MAX) (default -1)
   alpha_radius      <string>     ..FV....... Radius of the alpha blurring box
   ar                <string>     ..FV....... Radius of the alpha blurring box
   alpha_power       <int>        ..FV....... How many times should the boxblur be applied to alpha (from -1 to INT_MAX) (default -1)
   ap                <int>        ..FV....... How many times should the boxblur be applied to alpha (from -1 to INT_MAX) (default -1)

注意一下,lr和luma_radius是一个参数,lr是luma_radius的缩写,后面的类似。

  • luma是亮度,亮度的值越大,视觉上会越模糊,这个值最大是min(w,h)/2
  • chroma是色度,这个值越大,图片的颜色越淡,这个值最大是min(w,h)/2
  • luma_power和choma_power这个是迭代次数,即反复的再图片上执行均值模糊操作
使用

原图

明度和亮度都最大值的时候

复制代码
ffmpeg -y -i ffm_media/gee_short.jpg -filter_complex "boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1" /data/work_space/result/boxblur/boxblur_test_02.jpg
复制代码
ffmpeg -y -i ffm_media/gee_short.jpg -filter_complex "boxblur=luma_radius=1:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1" /data/work_space/result/boxblur/boxblur_test_08.jpg

色度最大值的时候

复制代码
ffmpeg -y -i ffm_media/gee_short.jpg -filter_complex "boxblur=luma_radius=min(cw\,ch)/10:luma_power=1:chroma_radius=1:chroma_power=1" /data/work_space/result/boxblur/boxblur_test_09.jpg

亮度最大值的时候

复制代码
ffmpeg -y -i ffm_media/gee_short.jpg -filter_complex "boxblur=luma_radius=10:luma_power=5:chroma_radius=1:chroma_power=1" /data/work_space/result/boxblur/boxblur_test_06.jpg

色度和亮度都比较小的时候

复制代码
## 祝你好运
 
hope("大神多多指点")
topic("有问题可以交流呀")
concat("求求QUN", "61480", "9646")
相关推荐
EasyDSS2 分钟前
视频监控从安装到优化的技术指南,视频汇聚系统EasyCVR智能安防系统构建之道
大数据·网络·网络协议·音视频
追逐☞2 小时前
机器学习(7)——K均值聚类
机器学习·均值算法·聚类
阿酷tony4 小时前
将视频生成视频二维码步骤
音视频·视频格式·视频二维码·视频生成二维码
9527华安4 小时前
国产紫光同创FPGA视频采集转SDI编码输出,基于HSSTHP高速接口,提供2套工程源码和技术支持
fpga开发·音视频·紫光同创·sdi·高速接口·hssthp
潮汐退涨月冷风霜5 小时前
开发了一个b站视频音频提取器
音视频
qq_316837755 小时前
使用ffmpeg 将图片合成为视频,填充模糊背景,并添加两段音乐
ffmpeg·音视频
林鸿群9 小时前
Mediamtx与FFmpeg远程与本地推拉流使用
ffmpeg
18538162800余。10 小时前
碰一碰发视频源码,碰一碰发视频OEM
音视频
一念春风14 小时前
C# 音频分离(MP3伴奏)
数据库·c#·音视频
Oliverro15 小时前
智慧景区国标GB28181视频平台EasyGBS视频融合应用全场景解决方案
网络·音视频