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")
相关推荐
眠りたいです3 小时前
基于脚手架微服务的视频点播系统-脚手架开发部分-FFmpeg,Etcd-SDK的简单使用与二次封装
c++·微服务·云原生·架构·ffmpeg·etcd
EasyGBS4 小时前
EasyGBS的“算法仓”如何重构视频监控价值
音视频
写代码的安徒生13 小时前
调用 Google Veo 3.1 API 批量制作电商产品 UGC 视频
python·音视频
Likeadust13 小时前
直播+互动+存储,视频直播点播平台EasyDSS新版重磅升级!一站式解决你的音视频难题
音视频
记忆偶然13 小时前
音频转文本技术方案解析与工具选型指南
音视频
mortimer14 小时前
用 PySide6 打造可视化 ASS 字幕样式编辑器:从需求到实现
python·ffmpeg·pyqt
撬动未来的支点15 小时前
【音视频】 RTP 与 RTMP 协议异同对比
音视频
电鱼智能的电小鱼15 小时前
基于电鱼 ARM 工控机的AI视频智能分析方案:让传统监控变得更聪明
网络·arm开发·人工智能·嵌入式硬件·算法·音视频
音视频牛哥15 小时前
SmartMediaKit 在检测机器人中的视频链路重构:从播放(RTSP)到二次水印编码再推流(RTSP|RTMP)
机器人·音视频·大牛直播sdk·rtsp二次编码·rtsp流二次水印保存mp4·rtsp流添加动态水印·检测机器人rtsp低延迟
CDialog19 小时前
播放本地音频的代码
音视频