Adding Border to the image using FFmpeg

∥☆過路亽.° 提交于 2021-02-08 05:44:35

问题


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

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?


回答1:


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

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

Note

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

=> Both files are same directory

=> 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 version I am using is ffmpeg version N-61041-g52a2138



来源:https://stackoverflow.com/questions/20325980/adding-border-to-the-image-using-ffmpeg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!