Revision e48f83fe

View differences:

vhook/imlib2.c
2 2
 * imlib2 based hook
3 3
 * Copyright (c) 2002 Philip Gladstone
4 4
 *
5
 * This module implements a text overlay for a video image. Currently it
6
 * supports a fixed overlay or reading the text from a file. The string
7
 * is passed through strftime so that it is easy to imprint the date and
8
 * time onto the image.
9
 *
10
 * You may also overlay an image (even semi-transparent) like TV stations do.
11
 * You may move either the text or the image around your video to create
12
 * scrolling credits, for example.
13
 *
14
 * Text fonts are being looked for in FONTPATH
15
 *
16
 * Options:
17
 *
18
 * -C <rgb.txt>         The filename to read RGB color names from
19
 *                      Defaults if none specified:
20
 *                      /usr/share/X11/rgb.txt
21
 *                      /usr/lib/X11/rgb.txt
22
 * -c <color>           The color of the text
23
 * -F <fontname>        The font face and size
24
 * -t <text>            The text
25
 * -f <filename>        The filename to read text from
26
 * -x <expression>      X coordinate of text or image
27
 * -y <expression>      Y coordinate of text or image
28
 * -i <filename>        The filename to read a image from
29
 * -R <expression>      Value for R color
30
 * -G <expression>      Value for G color
31
 * -B <expression>      Value for B color
32
 * -A <expression>      Value for Alpha channel
33
 *
34
 * Expressions are functions of:
35
 *      N  // frame number (starting at zero)
36
 *      H  // frame height
37
 *      W  // frame width
38
 *      h  // image height
39
 *      w  // image width
40
 *      X  // previous x
41
 *      Y  // previous y
42
 *
43

  
44
   Examples:
45

  
46
   FONTPATH="/cygdrive/c/WINDOWS/Fonts/"
47
   FONTPATH="$FONTPATH:/usr/share/imlib2/data/fonts/"
48
   FONTPATH="$FONTPATH:/usr/X11R6/lib/X11/fonts/TTF/"
49
   export FONTPATH
50

  
51
   ffmpeg -i input.avi -vhook \
52
     'vhook/imlib2.dll -x W*(0.5+0.25*sin(N/47*PI))-w/2 -y H*(0.5+0.50*cos(N/97*PI))-h/2 -i /usr/share/imlib2/data/images/bulb.png'
53
      -acodec copy -sameq output.avi
54

  
55
   ffmpeg -i input.avi -vhook \
56
     'vhook/imlib2.dll -c red -F Vera.ttf/20 -x 150+0.5*N -y 70+0.25*N -t Hello'
57
      -acodec copy -sameq output.avi
58

  
59 5
 * This module is very much intended as an example of what could be done.
60 6
 *
61 7
 * One caution is that this is an expensive process -- in particular the

Also available in: Unified diff