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")
相关推荐
XHW___0017 分钟前
音频调试时录制pcm数据
音视频·pcm
♛小小小让让9 分钟前
FourCC、编解码器、 文件后缀、视频容器的关系
笔记·音视频
智联视频超融合平台28 分钟前
智能互联新时代:视频联网平台与物联网的完美融合
人工智能·物联网·网络协议·系统安全·音视频
小c君tt1 小时前
ffmpeg-音-视频-基本概念
ffmpeg·音视频
Hello World,3 小时前
使用ffmpeg播放视频并添加当前时间水印
ffmpeg·音视频
EasyCVR3 小时前
视频融合平台EasyCVR赋能电梯监控智能化监管新格局
音视频
EasyDSS3 小时前
视频直播点播平台EasyDSS如何重塑金融数字化培训新模式?
金融·音视频
kilito_013 小时前
自制 音频 拖拉组件
音视频
筏.k3 小时前
WebRTC 集成 FFmpeg D3D12VA HEVC 硬件编码 avcodec_open2 返回 -22 问题排查与解决方案
ffmpeg·webrtc
简鹿办公6 小时前
用 MP3 Converter 提取 M4A 音频?超详细使用指南
音视频·手机视频转音频·手机视频转m4a