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")
相关推荐
Leon_Chenl8 小时前
【已开源】【嵌入式 Linux 音视频+ AI 实战项目】瑞芯微 Rockchip 系列 RK3588-基于深度学习的人脸门禁+ IPC 智能安防监控系统
深度学习·opencv·yolo·ffmpeg·音视频·边缘计算·人脸识别+检测
我是发哥哈11 小时前
三款主流AI视频生成模型商用能力对比与选型分析
大数据·人工智能·学习·ai·chatgpt·aigc·音视频
潜创微科技11 小时前
IT6622:HDMI1.4 发射 + eARC 音频接收 单芯片高清音视频方案
音视频
彷徨而立11 小时前
【音频编解码】音频编码格式 G.722、G.722.1、G.722.1.C 的区别
音视频
诸葛亮的芭蕉扇11 小时前
iOS视频自动全屏问题解决方案
ios·音视频
牛大兵12 小时前
播放网络摄像头视频支持ONVIF/RTSP
网络·python·音视频
antzou12 小时前
视频图片/文字水印
ffmpeg·视频水印·批量水印
这是程序猿13 小时前
ComfyUI 教程合集|AI绘图、ControlNet、Lora、IPAdapter、视频生成全攻略
大数据·人工智能·windows·音视频
ai产品老杨14 小时前
解构企业级AI视频中台:基于X86/ARM与GPU/NPU异构架构的深度演进与源码交付实践
arm开发·人工智能·音视频