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")
相关推荐
俊哥工具11 分钟前
解决文件正在使用无法删除,顽固文件清理工具超好用
智能手机·电脑·word·音视频·媒体
Digitally2 小时前
7 种方法将三星S26/S25/S24/S23手机视频传电脑
智能手机·电脑·音视频
luoyayun3613 小时前
Qt + FFmpeg 音频工具:重采样实现
qt·ffmpeg·重采样
阿拉斯攀登4 小时前
音视频采集:getUserMedia 与设备管理
音视频·webrtc·实时音视频·视频编解码
数据法师5 小时前
musicDownload :多平台音频资源聚合与本地化存储
音视频
小鹿软件办公5 小时前
通过调整编码参数使用 VLC 媒体播放器无损压缩视频方法
运维·网络·音视频
音乐宝贝家6 小时前
从合板到面单:麦杰克AC系列声学结构拆解与选购决策
新媒体运营·音视频·社交电子·业界资讯·媒体·用户运营·零售
AI服务老曹6 小时前
摄像机安装AI视频分析参数配置说明:POC现场交付全流程指南
人工智能·音视频
myenjoy_16 小时前
I2S 音频与数字音频接口详解
macos·音视频·xcode
cxr8281 天前
第14章 创意音乐与视频的多模态智能体创作
人工智能·音视频·智能体·hermes