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")
相关推荐
于是我说10 小时前
稳定常用能直接在电脑上下载微博视频的方法
音视频
ACP广源盛1392462567311 小时前
GSV2006@ACP#2 进 4 出 HDMI2.0 中继器(带音频提取 / 嵌入功能)全解析
单片机·嵌入式硬件·音视频
大模型实验室Lab4AI17 小时前
VideoLLaMA 3新一代前沿多模态基础模型赋能图像与视频深度理解| LLM | 计算机视觉
人工智能·计算机视觉·音视频
陈陈陈建蕾21 小时前
Mac使用FFmpeg进行屏幕录制,并使用VLC本地播放
ffmpeg·github
EasyDSS1 天前
视频推拉流平台EasyDSS无人机视频推拉流技术助力实现工地远程监控巡检直播
音视频·无人机
vivo互联网技术1 天前
Android动效探索:彻底弄清如何让你的视频更加酷炫
android·ffmpeg·跨平台·图形·mediaplayer·纹理·opengl es·坐标系
眠りたいです1 天前
基于脚手架微服务的视频点播系统-服务端开发部分接口定义,数据库表设计,视频索引设计,缓存与消息队列设计部分
数据库·c++·缓存·微服务·云原生·架构·音视频
EasyCVR1 天前
视频融合平台EasyCVR助力守护渔业牧区安全与增效
安全·音视频
大模型实验室Lab4AI1 天前
CVPR 2024 | 赋能大语言模型以精准理解视频时序瞬间 | LLM | 时序预测
人工智能·语言模型·音视频
YUJIANYUE1 天前
查立得PHP+mysql个人微博系统V1.0支持图文视频音频文件
mysql·php·音视频