问题
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