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")
相关推荐
揽秀亭长2 小时前
音频如何转成可编辑乐谱?扒谱工具完整使用流程与格式链路解析(2026 实操版)
音视频
I Am a robert girl2 小时前
Semantic Forcing:当视频生成学会“想清楚再动笔”
音视频·视频生成·ai视频·时序一致性·语义建模·事件语义
河南博为智能科技有限公司2 小时前
配电站房动环系统视频接入与AI巡检!
人工智能·音视频
开开心心就好4 小时前
游戏安装报错缺环境?运行库整合包补上
java·mysql·游戏·pdf·ocr·音视频·lua
ARM+FPGA+AI工业主板定制专家4 小时前
基于 Jetson 整机搭建 ROS2 开发环境:机器人软件环境配置指南
人工智能·机器人·音视频·机器人运控
开开心心就好6 小时前
重复图片查找工具,拖入文件夹就开搜
java·mysql·pdf·ocr·vim·音视频·emacs
Haooog8 小时前
语音 Agent 别抢话:用两段录音测出哪里会被截断
ffmpeg·语音助手·aiagent·语音活动检测·实时语音
林墨聊AIGC8 小时前
AI首尾帧一键生成连贯视频
大数据·人工智能·科技·ai作画·aigc·音视频
king13598745509 小时前
Clipstral 视频语义检索:FFmpeg PTS 验证、向量索引与端侧部署
人工智能·ffmpeg·音视频·大语言模型·llama·本地部署·llama.cpp
余槐i9 小时前
设90秒却出3分钟:MoneyPrinterTurbo时长失控的根源
人工智能·python·ffmpeg·whisper·tts