hi im trying to add text to live video stream but i keep getting error with my command, i already tried -filter_complex but no success

ffmpeg -loop 1 -i img1.jpg -vf 'pad=ceil(iw/2)*2:ceil(ih/2)*2:[0:v]drawtext='text=hello:fontsize=90:x=20:y=20:fontcolor=white@0.2'' -vcodec libx264 -vprofile baseline -x264opts keyint=40 -acodec aac -strict -2 -f flv rtmp://localhost/hls/test -y -stats -report

the error i get is

Unable to parse graph description substring: "drawtext=text=freedome:fontsize=90:x=20:y=20:fontcolor=white@0.2"


For simple filterchains, where one filter operates upon the output of an earlier filter, no input pads (like [0:v]) should be used. Also, there is an errant colon at the end of the pad filter. It should be a comma instead, so

-vf 'pad=ceil(iw/2)*2:ceil(ih/2)*2,drawtext=text="hello":fontsize=90:x=20:y=20:fontcolor=white@0.2'

In drawtext, you may need to specify a font if fontconfig is not available on your system.

  • thanks it worked great Aug 5 '20 at 6:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.