Opened 3 years ago

Closed 3 years ago

#9427 closed defect (wontfix)

Wrong vertical alignment in drawtext

Reported by: Michael Koch Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Michael Koch)

It's impossible to print several strings with drawtext in the same line. The vertical alignment depends on which characters are in the string. Can be reproduced as follows, case 1 without using "text_h":

ffmpeg -f lavfi -i color=yellow -lavfi drawtext=text='a_':x=20:y=50,drawtext=text='_gG':x=40:y=50,drawtext=text='':x=60:y=50 -frames 1 -y out1.png

Case 2 with "text_h" subtracted:

ffmpeg -f lavfi -i color=yellow -lavfi drawtext=text='a_':x=20:y=50-text_h,drawtext=text='_gG':x=40:y=50-text_h,drawtext=text='':x=60:y=50-text_h -frames 1 -y out2.png

In both cases the vertical alignment of the strings is wrong.

Change History (3)

comment:1 by Michael Koch, 3 years ago

Description: modified (diff)

comment:2 by Michael Koch, 3 years ago

The second string contains two accents or two "" characters. These characters are accepted in the command line, but are invisible here on TRAC.

comment:3 by Michael Koch, 3 years ago

Resolution: wontfix
Status: newclosed

I found a simple solution:
Replace y=50-text_h by y=50-ascent
This seems to work for all characters.

Note: See TracTickets for help on using tickets.