[FFmpeg-user] what's print() used to do in filter graph?

qw applemax82 at 163.com
Fri Jun 1 17:40:29 EEST 2018


Hi,


I use the filter of drawtext to put some text on video images. And I want to know the text width and height. I searched internet via google, and found one link that shows how to print text width and height


https://video.stackexchange.com/questions/22525/how-to-fit-word-to-width-with-ffmpeg-drawtext-filter/22531#22531


I rewrite the ffmpeg command as follow:


/usr/local/bin/ffmpeg -f lavfi -i smptehdbars=s=640x480 -vf "drawtext=fontsize=20:fontfile=/export/qiang/buildDir/evaluate-video-quality/founder.ttf:text='1':x=0+0*print(tw):y=0+0*print(th)" -vframes 1 -f null -


which can print text width and height related to fontsize.


I don't find the description of print() in the vf filtergraph in ffmpeg website, i.e. http://ffmpeg.org/ffmpeg-filters.html#drawtext-1


Where to get the detailed description of fontsize?


Is there another better way to get text width and height?


Thanks!


Regards


Andrew


More information about the ffmpeg-user mailing list