ffmpeg视频滤镜:添加边框-drawbox

滤镜介绍

drawbox

官网链接 => FFmpeg Filters Documentation

这个滤镜会给视频添加一个边框。

滤镜使用

参数
复制代码
   x                 <string>     ..FV.....T. set horizontal position of the left box edge (default "0")
   y                 <string>     ..FV.....T. set vertical position of the top box edge (default "0")
   width             <string>     ..FV.....T. set width of the box (default "0")
   w                 <string>     ..FV.....T. set width of the box (default "0")
   height            <string>     ..FV.....T. set height of the box (default "0")
   h                 <string>     ..FV.....T. set height of the box (default "0")
   color             <string>     ..FV.....T. set color of the box (default "black")
   c                 <string>     ..FV.....T. set color of the box (default "black")
   thickness         <string>     ..FV.....T. set the box thickness (default "3")
   t                 <string>     ..FV.....T. set the box thickness (default "3")
   replace           <boolean>    ..FV.....T. replace color & alpha (default false)
   box_source        <string>     ..FV.....T. use datas from bounding box in side data
  • x,y 表示边框的左上角的位置
  • width(w),height(h) 边框宽和高
  • color(c) 边框的颜色
  • thickness(t) 边框的粗细程度,传入fill的时候,就会将方框内的内容都填充颜色
  • replace表示 是不是在alpha通道上也添加边框
  • box_source 没有清楚这个参数的意思
案例

原图

复制代码
ffmpeg -y -i ffm_media/liuyifei.jpeg -filter_complex "drawbox=c=purple" result/drawbox/drawbox_test_004.jpg

添加了一个紫色的边框

复制代码
ffmpeg -y -i ffm_media/liuyifei.jpeg -filter_complex "drawbox=x=10:y=10:color=pink@0.5:t=fill" result/drawbox/drawbox_test_002.jpg

这个相当于添加了一个分数的遮罩

复制代码
## 祝你好运
 
hope("大神多多指点")
topic("有问题可以交流呀")
concat("球球QUN", "61480", "9646")
相关推荐
一招定胜负5 小时前
opencv视频处理
人工智能·opencv·音视频
行业探路者6 小时前
音频二维码让音频分享变得更简单快捷
学习·音视频·语音识别·二维码·设备巡检
EasyNVR19 小时前
docker版EasyNVR如何使用同步插件教程(包含网盘挂载,路径映射等)
docker·容器·音视频
IT陈图图20 小时前
Flutter × OpenHarmony 跨端实践:从零构建一个轻量级视频播放器
flutter·音视频·鸿蒙·openharmony
深圳市友昊天创科技有限公司1 天前
友昊天创推出8K ,4K 120Hz 100米延长器方案
音视频·实时音视频·视频编解码
视频技术分享1 天前
国产化视频会议安全加密技术行业应用案例集
音视频·实时音视频
xmRao1 天前
Qt+FFmpeg 实现 Windows 音频采集
windows·qt·ffmpeg
智慧的牛1 天前
浏览器网页播放A律音频实时流方案
websocket·音视频·码流转换·web audio api
深圳市友昊天创科技有限公司1 天前
ASM4242 雷电扩展坞 CV4242 PCIE扩展坞
音视频·实时音视频·视频编解码
IT陈图图1 天前
Flutter × OpenHarmony 实战:从 0 构建视频播放器的分类导航模块
flutter·华为·音视频·openharmony