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