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")
相关推荐
沃达德软件7 小时前
视频侦查技术揭秘
人工智能·opencv·计算机视觉·视觉检测·音视频·实时音视频·视频编解码
忧云9 小时前
解锁视频动感密码:AE Twitch 插件全方位使用指南
音视频
沃达德软件10 小时前
视频标注技术全解析
人工智能·目标检测·计算机视觉·视觉检测·音视频·实时音视频·视频编解码
重庆Debug11 小时前
当我试图搞清楚 FFmpeg 的硬件加速时,我写了一个能自动检测所有 GPU 编码器的小工具
ffmpeg
熊猫钓鱼>_>11 小时前
基于Trae/Whisper/FFmpeg与Knowledge Graph MCP技术开发语音生成会议纪要智能应用
开发语言·人工智能·python·深度学习·ffmpeg·whisper·trae
却道天凉_好个秋13 小时前
音视频学习(八十):离散余弦变换(DCT)
音视频·dct·视频压缩
源代码杀手14 小时前
Fun-Audio-Chat-8B 大型音频语言模型(Large Audio Language Model)
人工智能·语言模型·音视频
ACP广源盛1392462567314 小时前
GSV2125D@ACP#2125产品规格参数详解及产品应用分享
嵌入式硬件·计算机外设·音视频
weixin1997010801614 小时前
TikTokitem_search_video关键词视频列表接口对接全攻略:从入门到精通
java·服务器·音视频
却道天凉_好个秋14 小时前
音视频学习(八十一):JPEG编解码
音视频·视频压缩·jpeg编码