I need to create a video with a set of images and I successfully did this with ffmpeg. now i need a way to add credits to the si开发者_Python百科nger and video creator. This is part of the work involved in the video creation tool im implementing. Can someone tell me how to add text to an image with ffmpeg.
Thanks in advance.
ffmpeg -i input.jpg -vf "drawtext=text='Test Text':fontcolor=white:fontsize=75:x=1002:y=100:" output.jpg
this code will write Test Text to the input.jpg and you will get it as output.jpg with text on it
If you already have the images, it will probably be most sensible to do such annotations directly to the images using Image Magick.
Take a look at the -draw
for text and -annotate
operators on convert
.
if you are using ffmpeg you can do this using drawtext filter;
I have added local Time on video with text TEST - prefix and black box as background with 0.7 opacity, you can add more parameters like font size etc as well;
ffmpeg -i input.mp4 -vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf:text='TEST- %{localtime\:%T}': fontcolor=white:box=1:boxcolor=black@0.7: x=70: y=400" -y output.mp4
精彩评论