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")
相关推荐
REDcker2 小时前
FFmpeg开发者快速入门
ffmpeg
不吃鱼的猫7483 小时前
【从零手写播放器:FFmpeg 音视频开发实战】04-封装格式与多媒体容器
c++·ffmpeg·音视频
九丝城主6 小时前
1V1音视频对话4--FLUTTER实现
flutter·音视频
张张说点啥7 小时前
能做影视级可商业视频的AI工具,Seedance 2.0 全球首发实测
人工智能·音视频
qq_433502187 小时前
收集了一些免费视频背景映月素材网站分享记录
经验分享·学习·音视频·生活
上海合宙LuatOS1 天前
LuatOS核心库API——【hmeta 】硬件元数据
单片机·嵌入式硬件·物联网·算法·音视频·硬件工程·哈希算法
一个人旅程~1 天前
QQ音乐、potplayer、VLC等对音乐格式的支持和加密文件格式的转换有哪些方法?potplayer的音质相对于VLC有哪些特点?
windows·经验分享·电脑·音视频
音视频牛哥1 天前
从协议栈到工程落地:SmartMediaKit全链路模块化架构深度解析
音视频·rtsp播放器·rtmp播放器·安卓rtsp服务器·安卓轻量级rtsp服务·安卓rtsp摄像头推流·安卓摄像头rtmp推流
奔跑吧 android1 天前
【车载Audio】【AudioHal 04】【高通音频架构】【从 AHAL adev_open 到 PAL XML 解析:30微秒内的调用链深度追踪】
音视频·audiohal·车载audio·高通音频架构·ahal·audiofinger
REDcker1 天前
FFmpeg完整文档
linux·服务器·c++·ffmpeg·音视频·c·后端开发