~ubuntu-branches/ubuntu/jaunty/xvidcap/jaunty-proposed

« back to all changes in this revision

Viewing changes to ffmpeg/doc/hooks.texi

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2008-02-25 15:47:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080225154712-qvr11ekcea4c9ry8
Tags: 1.1.6-0.1ubuntu1
* Merge from debian-multimedia (LP: #120003), Ubuntu Changes:
 - For ffmpeg-related build-deps, remove cvs from package names.
 - Standards-Version 3.7.3
 - Maintainer Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
order that they were specified on the ffmpeg command line.
19
19
 
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.
22
22
 
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.
26
26
 
27
27
@section null.c
41
41
 
42
42
@section imlib2.c
43
43
 
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.
47
 
 
 
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
 
47
time onto the image.
 
48
 
 
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.
 
52
 
 
53
Text fonts are being looked for in a FONTPATH environment variable.
 
54
 
 
55
Options:
 
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
 
64
@end multitable
 
65
 
 
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
 
75
@end multitable
 
76
 
 
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)}.
 
80
 
 
81
Usage examples:
 
82
 
 
83
@example
 
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/"
 
88
   export FONTPATH
 
89
 
 
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
 
94
 
 
95
   # Text scrolling
 
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
 
99
@end example
 
100
 
 
101
@section ppm.c
 
102
 
 
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).
 
106
 
 
107
Usage example:
 
108
 
 
109
@example
 
110
ffmpeg -i input -vhook "/path/to/ppm.so some-ppm-filter args" output
 
111
@end example
48
112
 
49
113
@bye