]> git.sesse.net Git - mlt/blob - docs/inigo.txt
fix westley for mixed element text and entity references
[mlt] / docs / inigo.txt
1 INIGO
2 -----
3
4 Preamble:
5
6         inigo was developed as a test tool for the MLT framework. It can
7         be thought of as a powerful, if somewhat obscure, multitrack
8         command line oriented video editor.
9
10         The following details the usage of the tool and as a result,
11         provides a lot of insight into the workings of the MLT framework.
12
13
14 Usage:
15
16         inigo [ -group [ name=value ]* ]
17               [ -consumer id[:arg] [ name=value ]* ]
18               [ -filter id[:arg] [ name=value ] * ]
19               [ -transition id[:arg] [ name=value ] * ]
20               [ -blank frames ]
21               [ -track ]
22               [ producer [ name=value ] * ]+
23               [ -serialise file.inigo ]
24
25
26 General rules:
27
28         1. Order is incredibly important;
29
30         2. Error checking on command line parsing is weak;
31
32         3. Please refer to services.txt for details on services 
33         available;
34
35         4. The MLT framework, from which inigo has inherited its 
36         naming convention, is very mlt-centric. Producers produce 
37         MLT frame objects and consumers consume MLT frame objects. 
38         The distinction is important - a DV producer does not produce 
39         DV, it produces MLT frames from a DV source, and similarly a 
40         DV consumer does not consume DV, it consumes MLT frames and 
41         produces DV frames.
42
43
44 Terminology:
45
46         'Producers' typically refer to files but may also indicate
47         devices (such as dv1394 input or video4linux). Hence, the more
48         generic term is used [yes, the more generic usage is out of
49         scope for now...].
50
51         'Filters' are frame modifiers - they always guarantee that for
52         every frame they receive, they output *precisely* one frame.
53         Never more, never less, ever.
54         
55         'Transitions' collect frames from two tracks (a and b) and
56         output 1 modified frame on their 'a track', and 1 unmodified
57         frame on their 'b track'. Never more, never less, ever.
58         
59         'Consumers' collect frames from a producer, do something with
60         them and destroy them.
61         
62         Collectively, these are known as 'services'. 
63         
64         All services have 'properties' associated to them. These are
65         typically defaulted or evaluated and may be overriden on a case
66         by case basis.
67         
68         All services except consumers obey in and out properties.
69         
70         Consumers have no say in the flow of frames [though they may
71         give the illusion that they do]. They get frames from a
72         connected producer, use them, destroy them and get more.
73
74
75 Basics:
76
77         To play a file with the default SDL PAL consumer, usage is:
78         
79         $ inigo file
80         
81         Note that 'file' can be anything that inigo has a known
82         'producer' mapping for (so this can be anything from .dv to
83         .txt).
84
85
86 Properties:
87
88         Properties can be assigned to the producer by adding additional
89         name=value pairs after the producer:
90         
91         $ inigo file in=50 out=100 something="something else"
92         
93         Note that while some properties have meaning to all producers (for 
94         example: in, out and length are guaranteed to be valid for all, though 
95         typically, length is determined automatically), the validity of others 
96         are dependent on the producer - however, properties will always be 
97         assigned and silently ignored if they won't be used.
98
99
100 Multiple Files:
101
102         Multiple files of different types can be used:
103         
104         $ inigo a.dv b.mpg c.png
105         
106         Properties can be assigned to each file:
107         
108         $ inigo a.dv in=50 out=100 b.mpg out=500 c.png out=500
109
110         MLT will take care of 'normalising' the output of a producer to ensure
111         that the consumer gets what it needs. So, in the case above, the mlt
112         framework will ensure that images are rescaled and audio resampled to meet
113         the requirements of your configuration (which, by default, will be PAL).
114         See 'Appendix A: Normalisation Rules' below.
115
116
117 Filters:
118
119         Filters are frame modifiers - they can change the contents of the audio or
120         the images associated to a frame.
121
122         $ inigo a.dv -filter greyscale
123
124         As with producers, properties may be specified on filters too.
125         
126         Again, in and out properties are common to all, so to apply a filter to a 
127         range of frames, you would use something like:
128         
129         $ inigo a.dv -filter greyscale in=0 out=50
130         
131         Again, filters have their own set of rules about properties and will
132         silently ignore properties that do not apply.
133
134
135 Groups:
136
137         The -group switch is provided to force default properties on the
138         following 'services'. For example:
139         
140         $ inigo -group in=0 out=49 clip*
141         
142         would play the first 50 frames of all clips that match the wild
143         card pattern.
144         
145         Note that the last -group settings also apply to the following
146         filters, transitions and consumers, so:
147         
148         $ inigo -group in=0 out=49 clip* -filter greyscale
149         
150         is *probably not* what you want (ie: the greyscale filter would
151         only be applied to the first 50 frames).
152         
153         To shed the group properties, you can use any empty group:
154         
155         $ inigo -group in=0 out=49 clip* -group -filter greyscale
156
157
158 Introducing Tracks and Blanks:
159
160         So far, all of the examples have shown the definition of a single
161         playlist, or more accurately, track.
162
163         When multiple tracks exist, the consumer will receive a frame
164         from the 'lowest numbered' track that is generating a non-blank
165         frame.
166         
167         It is best to visualise a track arrangement, so we'll start with
168         an example:
169         
170         $ inigo a.dv in=0 out=49 -track b.dv
171         
172         This can be visualised as follows:
173         
174         +-------+
175         |a      |
176         +-------+----------+
177         |b                 |
178         +------------------+
179         
180         Playout will show the first 50 frames of a and the 51st frame
181         shown will be the 51st frame of b.
182         
183         To have the 51st frame be the first frame of b, we can use the 
184         -blank switch:
185         
186         $ inigo a.dv out=49 -track -blank 49 b.dv
187         
188         Which we can visualise as:
189         
190         +-------+
191         |a      |
192         +-------+-------------------+
193                 |b                  |
194                 +-------------------+
195         
196         Now playout will continue as though a and b clips are on the
197         same track (which on its own, is about as useful as reversing the 
198         process of slicing bread).
199
200
201 Transitions:
202
203         Where tracks become useful is in the placing of transitions.
204         
205         Here we need tracks to overlap, so a useful multitrack
206         definition could be given as:
207         
208         $ inigo a.dv out=49 \
209                 -track \
210                 -blank 24 b.dv \
211                 -transition luma in=25 out=49 a_track=0 b_track=1
212         
213         Now we're cooking - our visualisation would be something like:
214         
215         +-------+
216         |a      |
217         +---+---+--------------+
218             |b                 |
219             +------------------+
220         
221         Playout will now show the first 25 frames of a and then a fade
222         transition for 25 frames between a and b, and will finally
223         playout the remainder of b.
224
225
226 Reversing a Transition:
227
228         When we visualise a track definition, we also see situtations
229         like:
230         
231         +-------+              +----------+
232         |a1     |              |a2        |
233         +---+---+--------------+----+-----+
234             |b                      |
235             +-----------------------+
236         
237         In this case, we have two transitions, a1 to b and b to a2. 
238         
239         In this scenario, we define a command line as follows:
240         
241         $ inigo a.dv out=49 -blank 49 a2.dv \
242                 -track \
243                 -blank 24 b.dv out=99 \
244                 -transition luma in=25 out=49 a_track=0 b_track=1 \
245                 -transition luma in=100 out=124 reverse=1 a_track=0 b_track=1
246
247
248 Serialisation:
249
250         Inigo has a built in serialisation mechanism - you can build up
251         your command, test it via any consumer and then add a -serialise
252         file.inigo switch to save it.
253         
254         The saved file can be subsequently used as a clip by either
255         miracle or inigo. Take care though - paths to files are saved as
256         provided on the command line....
257
258         A more expressive serialisation can be obtained with the westley consumer
259         - this will provide an xml document which can be used freely in inigo and
260         miracle.
261
262         See westley.txt for more information.
263
264
265 Missing Features:
266
267         Some filters/transitions should be applied on the output frame regardless
268         of which track it comes from - for example, you might have a 3rd text 
269         track or a watermark which you want composited on every frame, and of 
270         course, there's the obscure filter.... 
271         
272         inigo only supports this in two invocations - as a simple example:
273
274         $ inigo a.dv -track -blank 100 b.dv -consumer westley:basic.westley
275         $ inigo basic.westley -filter watermark:watermark.png
276