[FFmpeg-devel] [PATCH] libavfilter: increase vf_drawtext line height

Timothy Gu timothygu99 at gmail.com
Wed Oct 1 19:32:41 CEST 2014


On Wed, Oct 1, 2014 at 7:07 AM, Михаил Муковников <yndi at me.com> wrote:
> It’s a common practice to add some space between lines (typically 0.2 * font-height) as it dramatically increases readability. In my opinion, the default behaviour increasing the height just by max_glyph_h is not a very good one.
>
> diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
> index 4fbb6c0..9d68a27 100644
> --- a/libavfilter/vf_drawtext.c
> +++ b/libavfilter/vf_drawtext.c
> @@ -1232,7 +1232,7 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame,
>          if (is_newline(code)) {
>
>              max_text_line_w = FFMAX(max_text_line_w, x);
> -            y += s->max_glyph_h;
> +            y += s->max_glyph_h * 1.2;
>              x = 0;
>              continue;
>          }

I think the line spacing should be user-changeable through an AVOption.

Timothy


More information about the ffmpeg-devel mailing list