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")
相关推荐
沐禾安信4 小时前
AVI 视频打不开?2026 四款转 MP4 工具封神
音视频·电脑录屏
兵叔物联6 小时前
基于FFmpeg的短视频自动剪辑工具
ffmpeg·音视频
AORUO奥偌6 小时前
从“拼凑”到“集成”:音视频系统如何重塑弱电智能化建设逻辑
音视频·公共广播系统·音视频系统·多媒体会议与ip广播系统·多媒体会议系统
禹亮科技6 小时前
大型国企会议室音视频集成实战:3间120㎡空间Poly G7500+LED大屏+讯飞多语言会议系统落地方案
音视频·视频会议系统集成·上海禹亮科技·讯飞听见多语言会议系统·poly g7500
音视频牛哥8 小时前
SmartMediaKit macOS版RTSP/RTMP低延迟播放器:技术架构、核心能力与应用实践
音视频·低延迟rtsp播放器·macos直播播放器·macos rtsp播放器·macos rtmp播放器·rtsp播放器mac版·rtmp播放器mac版
潜创微科技11 小时前
沁恒CH9339:USB3.0超高速对拷,两台电脑一根线共享一切
音视频
Cxiaomu11 小时前
从 TRTC Demo 到独立音视频服务:React + TRTC Web SDK 服务化实践
前端·react.js·音视频
EasyGBS15 小时前
政务视频资源汇聚:国标GB28181视频平台EasyGBS在“一网统管”中的定位和落地路径
网络·音视频·政务
蝉蜕日记1 天前
视频压缩 v1.1.31:高效压缩,无损画质,释放存储空间
音视频·生活·视频编解码·视频·软件需求
lumengabc1 天前
视频制作流程MP4旁白语音生成裁剪视频压缩python处理ppt转视频M4a格式
音视频