[FFmpeg-devel] [PATCH] avfilter:vf_drawtext: add new line space size set parameter

Michael Niedermayer michaelni at gmx.at
Tue Jan 17 21:32:20 EET 2017


On Tue, Jan 17, 2017 at 07:36:03PM +0800, Steven Liu wrote:
> add line_spacing parameter to set the space between two lines
> 
> Based on an idea by: Leandro Santiago <leandrosansilva at gmail.com>
> 
> Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
> ---
>  doc/filters.texi          | 4 ++++
>  libavfilter/vf_drawtext.c | 4 +++-
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 94548b1..a0c2980 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -6750,6 +6750,10 @@ option, check the "Color" section in the ffmpeg-utils manual.
>  
>  The default value of @var{boxcolor} is "white".
>  
> + at item line_spacing
> +Set the line spacing in pixels of the border to be drawn around the box using @var{box}.
> +The default value of @var{line_spacing} is 0.
> +
>  @item borderw
>  Set the width of the border to be drawn around the text using @var{bordercolor}.
>  The default value of @var{borderw} is 0.
> diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
> index 649240b..d8f7730 100644
> --- a/libavfilter/vf_drawtext.c
> +++ b/libavfilter/vf_drawtext.c
> @@ -158,6 +158,7 @@ typedef struct DrawTextContext {
>      int borderw;                    ///< border width
>      unsigned int fontsize;          ///< font size to use
>  
> +    int line_spacing;               ///< lines spacing in pixels
>      short int draw_box;             ///< draw box around text - true or false
>      int boxborderw;                 ///< box border width
>      int use_kerning;                ///< font kerning is used - true/false
> @@ -209,6 +210,7 @@ static const AVOption drawtext_options[]= {
>      {"shadowcolor", "set shadow color",     OFFSET(shadowcolor.rgba),   AV_OPT_TYPE_COLOR,  {.str="black"}, CHAR_MIN, CHAR_MAX, FLAGS},
>      {"box",         "set box",              OFFSET(draw_box),           AV_OPT_TYPE_BOOL,   {.i64=0},     0,        1       , FLAGS},
>      {"boxborderw",  "set box border width", OFFSET(boxborderw),         AV_OPT_TYPE_INT,    {.i64=0},     INT_MIN,  INT_MAX , FLAGS},

> +    {"line_spacing",  "set line spacing in pixels", OFFSET(line_spacing),   AV_OPT_TYPE_INT,    {.dbl=0},     INT_MIN,  INT_MAX,FLAGS},

AV_OPT_TYPE_INT should use .i64

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170117/dbcc7c61/attachment.sig>


More information about the ffmpeg-devel mailing list