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")
相关推荐
TechVoyager_82465 小时前
HDMI信号进来,音视频出去:IT66021FN的全链路解析
音视频·音视频处理·it66021·hdmi接收芯片·hdmi1.4b·硬件方案·音视频全链路
ValueHD8 小时前
视频会议终端是什么,有哪几种类型?
后端·音视频·视频编解码·腾讯会议
redfred8 小时前
HandBrake 使用教程:开源视频压缩工具 视频太大压缩 MKV转MP4 批量转码 硬件加速 Windows/macOS/Linux
windows·开源·音视频
老余说AI8 小时前
告别机械音与音画脱节:2026 AI视频翻译与配音工具深度测评与工程选型指南
人工智能·音视频·视频翻译·视频配音
阿童木写作9 小时前
自动智能抠图工具推荐:跨马翻译批量处理图片与视频字幕,跨境电商高效翻译
大数据·人工智能·python·音视频
乐橙开放平台9 小时前
把工地遮挡和掉线接进项目部:setMessageCallback 订 alarm 与 deviceStatus
笔记·后端·物联网·自动化·音视频·智能家居
IvanCodes11 小时前
FFmpeg安装与使用教程
ffmpeg
纽格立科技11 小时前
埋在地下的那张铜网
车载系统·音视频·信息与通信·传媒
极客猴子12 小时前
iPhone免费版支持思维导图导出的会议APP推荐:导出能力对照
人工智能·智能手机·音视频·机器翻译
硅谷秋水12 小时前
Zero-WAM:基于人类视频的上下文世界-动作建模,用于开放式任务泛化
人工智能·深度学习·计算机视觉·语言模型·机器人·音视频