Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFMPEG Command to add text to a image

Tags:

ffmpeg

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 singer 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.

like image 714
Paba Avatar asked Jul 15 '11 08:07

Paba


2 Answers

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

like image 144
Abdalla Mohamed Aly Ibrahim Avatar answered Sep 25 '22 15:09

Abdalla Mohamed Aly Ibrahim


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:[email protected]: x=70: y=400" -y output.mp4

like image 38
Faisal Ameer Avatar answered Sep 24 '22 15:09

Faisal Ameer