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")
相关推荐
goujunwe9 小时前
短视频怎么做 GEO:优化字幕和文稿,提升 AI 文本抓取采信率
大数据·人工智能·音视频
ZenasLDR10 小时前
LDR6021Q音频转接器应用介绍
音视频·音频·接口
apple_6926588511 小时前
一个开源 KTV 点歌项目电视大屏点歌系统,免激活码家庭K歌方案
开源·音视频
国产化创客13 小时前
ESP32音频/语音技术(7)ESP-NOW无线音频方案
音视频
AI视频工具指南15 小时前
怎么用 AI 做一两分钟的小故事视频?
人工智能·aigc·音视频
ACP广源盛1392462567316 小时前
项目评估记录:4K 远距离视频 Serdes 传输方案调研,GSV5800@ACP参数与工程问题记录
笔记·硬件架构·音视频·视频·国产芯片
碧海银沙音频科技研究院18 小时前
面向长尾音频分类的知识蒸馏研究
人工智能·算法·音视频
BeiGuTing_code19 小时前
C链表基础(二)有视频模拟!!!
c语言·链表·音视频
燕落南枝19 小时前
HTML 视频标签(video)详解笔记
笔记·html·音视频
霖霖71420 小时前
【ESP32笔记】I2S的音频录制与播放
笔记·单片机·mcu·音视频