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")
相关推荐
李二。21 小时前
鸿蒙原生ArkTS-鸿蒙6.0新特性-动态模糊视频背景登录页
华为·音视频·harmonyos
菊风 Juphoon21 小时前
认证合规刚需落地|菊风智能双录,助力CA机构全流程合规留痕
音视频·双录·认证双录
大蚂蚁2号1 天前
本地视频转文字,音频转文字免费工具
音视频
换个昵称都难1 天前
webrtc voice engine 介绍(新版webrtc)
ffmpeg·音视频·webrtc
searchforAI1 天前
2026年AI笔记工具对比实测:NotebookLM、通义听悟、Ai好记怎么选?
人工智能·笔记·gpt·ai·whisper·音视频·语音识别
音视频牛哥1 天前
基于 SmartMediaKit 的座舱远程遥控系统技术方案——面向多摄像头、多角度、低延迟传输控制与内网/5G广域网融合场景
音视频·低延迟rtsp播放器·低延迟视频传输·座舱远程遥控·5g远程控制·远程驾驶系统·低延迟rtmp播放
EasyGBS1 天前
从“后厨黑箱”到“透明厨房”:国标GB28181视频平台EasyGBS平台AI视频分析如何守护舌尖上的安全
人工智能·安全·音视频
昨日之日20061 天前
LongCat-Video-Avatar-1.5 - 一句话生成口型同步、动作稳定的数字人 说话/唱歌 视频 一键整合包下载
音视频
searchforAI1 天前
长视频和播客怎么变成结构化读书笔记?一套 AI 时代的知识管理方法
人工智能·笔记·gpt·音视频·语音识别
不想吃饭e1 天前
uniapp-图片,视频上传组件封装
java·uni-app·音视频