[FFmpeg-devel] [PATCH] doc/filters: document drawtext draw expression

Clément Bœsch ubitux at gmail.com
Tue May 1 13:38:56 CEST 2012


On Tue, May 01, 2012 at 01:30:36PM +0200, Stefano Sabatini wrote:
> ---
>  doc/filters.texi |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index c529f00..bc0e2ae 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -1273,6 +1273,16 @@ Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format
>  (e.g. "0xff00ff"), possibly followed by an alpha specifier.
>  The default value of @var{boxcolor} is "white".
>  
> + at item draw
> +Set an expression which specifies if the text should be drawn. If the
> +expression evaluates to 0, the text is not drawn. This is useful for
> +specifying that the text should be drawn only when specific conditions
> +are met.
> +
> +Default value is "1".
> +
> +See below for the list of accepted constants and functions.
> +

Note: it would be nice to have a generic way of applying a filter to a
seek point and duration (expressed in ts or frame), without affecting the
rest of the stream.

>  @item fix_bounds
>  If true, check and fix text coords to avoid clipping.
>  
> @@ -1491,6 +1501,12 @@ drawtext=fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyp
>  @end example
>  
>  @item
> +Show text for 1 seconds every 3 seconds:
> + at example
> +drawtext=fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:draw=lt(mod(t\\,3)\\,1):text='blink'"
> + at end example
> +

It looks like you're closing the expression with a never opened double
quotation. Also, you are double escaping the comas (because of the "..."?)

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120501/a254038e/attachment.asc>


More information about the ffmpeg-devel mailing list