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")
相关推荐
菜包eo1 小时前
二维码驱动的独立站视频集成方案
网络·python·音视频
不太会编程的IT男2 小时前
在 Jetson Orin 开发套件上使用 Hardware Encoder / Decoder 构建 FFmpeg
ffmpeg·视频编解码·h.264
阿蒙Amon3 小时前
【Python小工具】使用 OpenCV 获取视频时长的详细指南
python·opencv·音视频
m0_687399843 小时前
写一个Ununtu C++ 程序,调用ffmpeg API, 来判断一个数字电影的视频文件mxf 是不是Jpeg2000?
开发语言·c++·ffmpeg
aqi005 小时前
FFmpeg开发笔记(七十一)使用国产的QPlayer2实现双播放器观看视频
android·ffmpeg·音视频·流媒体
正在走向自律8 小时前
第二章-AIGC入门-开启AIGC音频探索之旅:从入门到实践(6/36)
人工智能·aigc·音视频·语音识别·ai音乐·ai 音频·智能语音助手
Java患者·9 小时前
【小白】linux安装ffmpeg | java转码 【超详细】
ffmpeg
suifen_9 小时前
RK平台ffmpeg支持硬件编解码
ffmpeg
feiyangqingyun10 小时前
全网唯一/Qt结合ffmpeg实现手机端采集摄像头推流到rtsp或rtmp/可切换前置后置摄像头/指定分辨率帧率
qt·智能手机·ffmpeg
美狐美颜sdk15 小时前
跨平台直播美颜SDK集成实录:Android/iOS如何适配贴纸功能
android·人工智能·ios·架构·音视频·美颜sdk·第三方美颜sdk