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")
相关推荐
Highcharts.js2 分钟前
音频可视化图表开发|基于 Highcharts 内置音频合成器制作音乐排行榜图代码
javascript·信息可视化·音视频·highcharts
byte轻骑兵10 分钟前
【LE Audio】CAP精讲[8]:CCID绑定术,打通音频流与控制的任督二脉
网络·人工智能·音视频·le audio·音视频控制
编程牛马姐14 分钟前
YouTube视频一直转圈?加载卡顿原因分析与排查方法(2026)
音视频
ZC跨境爬虫16 分钟前
跟着 MDN 学 HTML day_64:从 object 到 iframe 的嵌入技术全面解析
开发语言·前端·javascript·ui·html·音视频
ZFSS25 分钟前
MultiNLI 多种类自然语言推理数据集介绍
人工智能·ai·ai作画·音视频·ai编程
runafterhit1 小时前
显示领域OLED专题调研-总入口
音视频
EasyCVR14 小时前
空地视频融合:国标GB28181视频监控EasyCVR打通无人机与指挥中心国标监控最后一公里
音视频·无人机
captain_AIouo16 小时前
Captain AI以视频运营破局!助Ozon商家抢占流量红利
大数据·人工智能·经验分享·aigc·音视频
ZC跨境爬虫17 小时前
跟着 MDN 学 HTML day_61:(构建反馈表单的结构化挑战)
前端·javascript·ui·html·音视频
南山有乔木78917 小时前
视频如何转换成音频mp3格式?视频音频分离实测有效
音视频