使用FFmpeg为图像添加边框 [英] Adding Border to the image using FFmpeg

查看:229
本文介绍了使用FFmpeg为图像添加边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望使用FFMPEG在单幅图像上添加边框.

I wish to add a border to the single strip of images, using FFMPEG.

我一直试图在Google上搜索此东西,我尝试了以下命令ffmpeg -i input.jpg -vf"draw box =:x = 50:y = 10:w = 104:h = 80:color = white"output.jpg,我无法增加边框大小以及所需的颜色,它仅适用于黑色边框.如何增加边框并将颜色更改为单条图像.有人可以帮我吗?

I have been trying to search this thing on google, I tried this command ffmpeg -i input.jpg -vf "draw box= : x=50 : y=10 : w=104 : h=80 : color=white" output.jpg, I am unable to increase the border size as well as my desired color,Its work only black border.how can I increase the border and change the color to the single strip of images. Can anybody help me?

推荐答案

在现有图像上添加边框类似于在某些图像上添加水印图像,

Adding border to an existing image is similar to add water mark image to some image,

这是ffmpeg命令,可为图像添加边框

Here is the ffmpeg command to add border to your image

ffmpeg -i image1.jpeg -vf "movie=border_1.png [watermark]; [in][watermark] overlay=0:0 [out]" one.jpg

注意

=>宽度&image1.jpeg和border1.png文件的高度应仅相同

=> Width & height of image1.jpeg and border1.png file should be same only

=>两个文件都在同一目录

=> Both files are same directory

=>在border_1.png中,除了border以外,其他所有区域都是透明的

=> In border_1.png, except border , all other area is transparent

这是我提到要在视频中添加水印的类似文章

Here is the similar article that I referred to add water mark to video

http://www.idude.net/index.php/how-to-watermark-a-video-using-ffmpeg/

在这种情况下,如果您想在视频中添加边框,则上述命令会有细微的变化

Inacase if you want to add border to your video then there is a minor change in above command

ffmpeg -i video1.mp4 -vf "movie=border_1.png [watermark]; [in][watermark] overlay=0:0 [out]" outputvideo.mp4

再次,请紧记&边框图像和视频的高度仅相同.

Now again , keep in mind widht & height of border image and video are same only.

ffmpeg版本是 ffmpeg版本N-61041-g52a2138

ffmpeg version I am using is ffmpeg version N-61041-g52a2138

这篇关于使用FFmpeg为图像添加边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆