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