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")
相关推荐
胖虎18 小时前
深入解析 iOS 视频录制(三):完整录制流程的实现与整合
ios·音视频·cocoa·ios视频录制·自定视频录制
AI服务老曹9 小时前
确保设备始终处于最佳运行状态,延长设备的使用寿命,保障系统的稳定运行的智慧地产开源了
人工智能·开源·云计算·音视频
余~~1853816280013 小时前
短视频矩阵碰一碰发视频源码技术开发,支持OEM
网络·人工智能·线性代数·矩阵·音视频
道剑剑非道15 小时前
YOLO11 【四】 【DNF制作自己的数据集,切割视频以及labelimg 闪退问题】
音视频
lucy1530275107915 小时前
芯麦GC4344立体声数模转换芯片深度解析:高精度音频与动态采样率技术
人工智能·单片机·物联网·机器学习·音视频·智能锁门锁
deadknight916 小时前
定期自动统计大表执行情况
ffmpeg
Black蜡笔小新20 小时前
WebRTC嵌入式视频通话SDK:EasyRTC从免插件到轻量级带来的音视频通话技术
音视频·webrtc·sdk·rtc·webp2p
EasyNVR20 小时前
EasyRTC:开启智能硬件与全平台互动新时代
网络·音视频·webrtc·p2p·智能硬件·视频监控
EasyGBS20 小时前
从开发到部署:EasyRTC嵌入式视频通话SDK如何简化实时音视频通信的集成与应用
音视频·webrtc·实时音视频·视频监控
AI服务老曹1 天前
通过感知、分析、预测、控制,最大限度发挥效率的智慧油站开源了
人工智能·开源·自动化·音视频