18
18
order that they were specified on the ffmpeg command line.
20
20
Three modules are provided and are described below. They are all intended to
21
be used as a base for your own modules.
21
be used as a base for your own modules.
23
23
Modules are loaded using the -vhook option to ffmpeg. The value of this parameter
24
is a space seperated list of arguments. The first is the module name, and the rest
24
is a space separated list of arguments. The first is the module name, and the rest
25
25
are passed as arguments to the Configure function of the module.
44
This allows a caption to be placed onto each frame. It supports inserting the
45
time and date. By using the imlib functions, it would be easy to add your own
46
graphical logo, add a frame/border, etc.
44
This module implements a text overlay for a video image. Currently it
45
supports a fixed overlay or reading the text from a file. The string
46
is passed through strftime so that it is easy to imprint the date and
49
You may also overlay an image (even semi-transparent) like TV stations do.
50
You may move either the text or the image around your video to create
51
scrolling credits, for example.
53
Text fonts are being looked for in a FONTPATH environment variable.
56
@multitable @columnfractions .2 .8
57
@item @option{-c <color>} @tab The color of the text
58
@item @option{-F <fontname>} @tab The font face and size
59
@item @option{-t <text>} @tab The text
60
@item @option{-f <filename>} @tab The filename to read text from
61
@item @option{-x <expresion>} @tab X coordinate of text or image
62
@item @option{-y <expresion>} @tab Y coordinate of text or image
63
@item @option{-i <filename>} @tab The filename to read a image from
66
Expresions are functions of these variables:
67
@multitable @columnfractions .2 .8
68
@item @var{N} @tab frame number (starting at zero)
69
@item @var{H} @tab frame height
70
@item @var{W} @tab frame width
71
@item @var{h} @tab image height
72
@item @var{w} @tab image width
73
@item @var{X} @tab previous x coordinate of text or image
74
@item @var{Y} @tab previous y coordinate of text or image
77
You may also use the constants @var{PI}, @var{E}, and the math functions available at the
78
FFmpeg formula evaluator at (@url{ffmpeg-doc.html#SEC13}), except @var{bits2qp(bits)}
79
and @var{qp2bits(qp)}.
84
# Remember to set the path to your fonts
85
FONTPATH="/cygdrive/c/WINDOWS/Fonts/"
86
FONTPATH="$FONTPATH:/usr/share/imlib2/data/fonts/"
87
FONTPATH="$FONTPATH:/usr/X11R6/lib/X11/fonts/TTF/"
90
# Bulb dancing in a Lissajous pattern
91
ffmpeg -i input.avi -vhook \
92
'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' \
93
-acodec copy -sameq output.avi
96
ffmpeg -i input.avi -vhook \
97
'vhook/imlib2.dll -c red -F Vera.ttf/20 -x 150+0.5*N -y 70+0.25*N -t Hello' \
98
-acodec copy -sameq output.avi
103
It's basically a launch point for a PPM pipe, so you can use any
104
executable (or script) which consumes a PPM on stdin and produces a PPM
105
on stdout (and flushes each frame).
110
ffmpeg -i input -vhook "/path/to/ppm.so some-ppm-filter args" output