[FFmpeg-devel] proposal for a minor change in the behavior of the drawtext filter

Francesco Carusi klimklim at tiscali.it
Fri Apr 22 18:07:50 EEST 2022


Hi Michael,

you're right, the default y position is not referred to the baseline but 
to the upper left corner of the text. I initially referred it to the 
baseline but that is not the default used by the current drawtext 
filter, so I thought it would be better to keep compatibility with the 
current filter.
I'm open to both solutions: if I refer the y parameter to the text 
baseline, than the current default can be achieved using the expression:

y = <value> + top_a

being "top_a" a new variable I'm introducing with the meaning "maximum 
ascent of the first line".
If I keep the current default, than what you're asking can be obtained 
using:

y = <value> - top_a

I'm new to the ffmpeg devs community so I'm not sure whether it is 
preferred to keep backward compatibility or to change the behavior in 
the name of a better interface.

What do you think?

Thanks
Francesco

On 22/04/2022 15:22, Michael Koch wrote:
> Hi Francesco,
>
> in my opinion the line spacing looks good. But there is still the 
> problem that the y position of the baseline depends on the height of 
> the characters in the first line. You see that when you switch between 
> your pictures line_height_net_arial.png  and line_height_new_arial2.png.
> I know that it can be corrected by specifying the y position as 
> "40-ascent" for example. Is it possible to make that the default?
>
> Michael
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-devel mailing list