Revision a5b64584 doc/filters.texi

View differences:

doc/filters.texi
353 353
drawbox=10:20:200:60:red@@0.5"
354 354
@end example
355 355

  
356
@section drawtext
357

  
358
Draw text string or text from specified file on top of video using the
359
libfreetype library.
360

  
361
To enable compilation of this filter you need to configure FFmpeg with
362
@code{--enable-libfreetype}.
363

  
364
The filter also recognizes strftime() sequences in the provided text
365
and expands them accordingly. Check the documentation of strftime().
366

  
367
The filter accepts parameters as a list of @var{key}=@var{value} pairs,
368
separated by ":".
369

  
370
The description of the accepted parameters follows.
371

  
372
@table @option
373

  
374
@item fontfile
375
The font file to be used for drawing text. Path must be included.
376
This parameter is mandatory.
377

  
378
@item text
379
The text string to be drawn. The text must be a sequence of UTF-8
380
encoded characters.
381
This parameter is mandatory if no file is specified with the parameter
382
@var{textfile}.
383

  
384
@item textfile
385
A text file containing text to be drawn. The text must be a sequence
386
of UTF-8 encoded characters.
387

  
388
This parameter is mandatory if no text string is specified with the
389
parameter @var{text}.
390

  
391
If both text and textfile are specified, an error is thrown.
392

  
393
@item x, y
394
The offsets where text will be drawn within the video frame.
395
Relative to the top/left border of the output image.
396

  
397
The default value of @var{x} and @var{y} is 0.
398

  
399
@item fontsize
400
The font size to be used for drawing text.
401
The default value of @var{fontsize} is 16.
402

  
403
@item fontcolor
404
The color to be used for drawing fonts.
405
Either a string (e.g. "red") or in 0xRRGGBB[AA] format
406
(e.g. "0xff000033"), possibly followed by an alpha specifier.
407
The default value of @var{fontcolor} is "black".
408

  
409
@item boxcolor
410
The color to be used for drawing box around text.
411
Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format
412
(e.g. "0xff00ff"), possibly followed by an alpha specifier.
413
The default value of @var{boxcolor} is "white".
414

  
415
@item box
416
Used to draw a box around text using background color.
417
Value should be either 1 (enable) or 0 (disable).
418
The default value of @var{box} is 0.
419

  
420
@item ft_load_flags
421
Flags to be used for loading the fonts.
422

  
423
The flags map the corresponding flags supported by libfreetype, and are
424
a combination of the following values:
425
@table @var
426
@item default
427
@item no_scale
428
@item no_hinting
429
@item render
430
@item no_bitmap
431
@item vertical_layout
432
@item force_autohint
433
@item crop_bitmap
434
@item pedantic
435
@item ignore_global_advance_width
436
@item no_recurse
437
@item ignore_transform
438
@item monochrome
439
@item linear_design
440
@item no_autohint
441
@item end table
442
@end table
443

  
444
Default value is "render".
445

  
446
For more information consult the documentation for the FT_LOAD_*
447
libfreetype flags.
448

  
449
@item tabsize
450
The size in number of spaces to use for rendering the tab.
451
Default value is 4.
452
@end table
453

  
454
For example the command:
455
@example
456
drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
457
@end example
458

  
459
will draw "Test Text" with font FreeSerif, using the default values
460
for the optional parameters.
461

  
462
The command:
463
@example
464
drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
465
          x=100: y=50: fontsize=24: fontcolor=yellow@@0.2: box=1: boxcolor=red@@0.2"
466
@end example
467

  
468
will draw 'Test Text' with font FreeSerif of size 24 at position x=100
469
and y=50 (counting from the top-left corner of the screen), text is
470
yellow with a red box around it. Both the text and the box have an
471
opacity of 20%.
472

  
473
Note that the double quotes are not necessary if spaces are not used
474
within the parameter list.
475

  
476
For more information about libfreetype, check:
477
@url{http://www.freetype.org/}.
478

  
356 479
@section fade
357 480

  
358 481
Apply fade-in/out effect to input video.

Also available in: Unified diff