-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathHowtoVeejay-PureData.html
503 lines (503 loc) · 26 KB
/
HowtoVeejay-PureData.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta name="GENERATOR" content="SGML-Tools 1.0.9">
<title>Using sendVIMS to write simple control paches for veejay in
PureData</title>
</head>
<body>
<h1>Using sendVIMS to write simple control paches for veejay in PureData</h1>
<h2>M. van Henten cola at looze.net</h2>
V0.01 104-10-09
<hr><em>
<!--
sendVIMS
-->SendVIMS is a Puredata external written by Niels
Elburg and Tom Schouten. It is a control interface to veejay, a
realtime video processing package.
I will explain some of my work using both tools together.</em>
<hr>
<h2><a name="s1">1. Introduction</a></h2>
<p>
<!--
sendVIMS!introduction
--> SendVIMS is a Puredata external written
by Niels Elburg and Tom Schouten. It is a control interface to veejay,
a realtime video processing package. VIMS stands for 'Veejay's Internal
Messaging System.<br>
I have been working with veejay
for a long time now so I took my knowledge of what it could do and
built a few paches that will demonstrate the power of building
interactive controls for veejay. This might be interesting for the
newcomers to linux video, but also for the experienced who want to know
more about veejay, and puredata although it is not intended as step by
step guide on how to use PureData or veejay( Especially since I'm
rather new to PureData), but I will try to explain some basics on how
to get this working.
</p>
<h2>1.1 Copyright</h2>
<p>This document is Copyright © 104-10-09 M. van Henten.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
</p>
<h2>1.2 Disclaimer</h2>
<p>Use the information in this document at your own risk. I disavow any
potential liability for the contents of this document. Use of the
concepts, examples, and/or other content of this document is entirely
at your own risk.
</p>
<p>All copyrights are owned by their owners, unless specifically noted
otherwise. Use of a term in this document should not be regarded as
affecting the validity of any trademark or service mark.
</p>
<p>Naming of particular products or brands should not be seen as
endorsements.
</p>
<p>You are strongly recommended to take a backup of your system before
major installation and backups at regular intervals.
</p>
<h2>1.3 News</h2>
<p>9-10-2004
Started Writing first draft to this howto, after finishing up on some
basic patches.
</p>
<h2>1.4 Credits</h2>
<p>Many thanks to of course to Tom Schouten en Niels Elburg for
creating this tool, thanks to Niels for creating veejay after numerous
sessions of feature dreaming, and continue working on it to create more
then we ever fantasized about. </p>
<p>Also, much obliged to the people in te PureData community, who
helped me getting started in the first place.Thanks to Derek Holzer,
who introduced me to PD and showed me how easy and fun PD was.
</p>
<p>A thankyou should be in place for the people at BEK (
http://www.bek.no) Who brought a lot of video guys in the OS world
together, and made this collaboration possible in the first place.
</p>
<h2><a name="s2">2. Technologies</a></h2>
<p style="font-weight: bold;">2.1 Expected Skills<br>
</p>
<p>I assume that you know how to work with the linux commandline.
Veejay is ( up to this date) mainly a console application ( besides the
video bit of course) and you <span
style="font-weight: bold; font-style: italic;">need to type stuff</span><span
style="font-style: italic;"> </span>to get it working. If this is all
too strange for you, I would advice you to get know a bit more of linux
first, by reading some magazines, and some howto's ( <a
href="http://www.tldp.org">the linux documentation project</a> has a
lot of howto's) like the <a
href="http://tldp.org/HOWTO/DOS-Win-to-Linux-HOWTO.html">windows/dos
to linux howto</a>. <br>
</p>
<p><span style="font-weight: bold;">2.2 Veejay</span><br>
</p>
<p>First of all, you need to download and install a later version of
veejay. In this document, I used veejay-0.6.2. Any version before
0.5.9 will not work as expected, or not at all together with SendVims. <br>
</p>
<p>Veejay sources are located <a href="http://veejay.sourceforge.net">http://veejay.sourceforge.net</a>,
or go directly to the <a href="http://www.sf.net/projects/veejay">sourceforge
download area</a>.<br>
Installation is standard: open a shell, or terminal, unpack the package
somehwere, go into the newly created directory, and type:<br>
</p>
<p>./configure<br>
</p>
<p>when configure has finished, something like:<br>
</p>
<p> <small><span
style="font-family: courier new,courier,monospace;">veejay 0.6.2 build
configuration :</span><br
style="font-family: courier new,courier,monospace;">
<br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;"> Build
configuration:</span><br
style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
MMX
enabled
: true</span><br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
MMX2
enabled
: false</span><br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
SSE
enabled
: true</span><br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
3DNow
enabled
: false</span><br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
CMOV
enabled
: true</span><br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
glibc support for >2GB files : true</span><br
style="font-family: courier new,courier,monospace;">
<br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;"> Required
dependencies:</span><br
style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
POSIX Threads (pthread)
: true</span><br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
video4linux recording/playback : true</span><br
style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
Simple Direct Media Layer : true</span><br
style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
XML C library for Gnome libxml2 : true</span><br
style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
libJPEG
: true</span><br style="font-family: courier new,courier,monospace;">
<br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;"> Optional
dependencies:</span><br
style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
libDV (digital
video)
: true</span><br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
Jack Audio Connection Kit : true</span><br
style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
DirectFB
support
: false</span></small><br>
<br>
</p>
Should appear.<br>
<br>
Note that veejay depends on the <a href="http://www.xmlsoft.org/">XML
C library</a> ( it comes as part of the GNOME libraries and desktop)
and <a href="http://www.libsdl.org">SDL</a>, if you don't have these
packages you should install them. <a
href="http://libdv.sourceforge.net">Libdv</a> is optional, for being
able to play dv type 2 format avi's, <a
href="http://jackit.sourceforge.net">jack</a> is optional but needed
if you want to hear sound with your movies. <br>
<br>
Describing how to get jack working optimal is not within the scope of
this document, I can only say that if you have jack setup properly
veejay should be able to output sound. <br>
<br>
When this is done, do a "make" followed by a "make install".<br>
Veejay should now be installed. Get some movie to edit( you can borrow
one from me <a href="http://cola.looze.net/sendvims/video/">here</a>) <br>
<p style="font-weight: bold;">2.2 PureData</p>
<p>PureData is a whole story upon itself. Please read the installation
notes and documentation on <a href="http://www.puredata.org">http://www.puredata.org</a>.
You can verify if everything works by just running pd, goto help en
check out some of the example paches. Using the documentation
from within pd you should at least get some basic understanding.<br>
</p>
<p><span style="font-weight: bold;">2.3 SendVims</span><br>
</p>
<p>In this document I used sendVIMS-0.1. <br>
This is compied from the README in sendVIMS-0.1.tar.gz :<br>
<br>
</p>
<p><small><span style="font-family: courier new,courier,monospace;">sendVIMS
- very simple VeeJay client for pure data</span><br
style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
(C) 2002-2004 Niels Elburg <[email protected]></span><br
style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">
(C) 2004 Tom Schouten <[email protected]></span><br
style="font-family: courier new,courier,monospace;">
<br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">This is free
software covered under the terms of the</span><br
style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">GNU GPL. See
the file COPYING for details.</span><br
style="font-family: courier new,courier,monospace;">
<br style="font-family: courier new,courier,monospace;">
<br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">building:</span><br
style="font-family: courier new,courier,monospace;">
<br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">./configure
&& make && make install</span><br
style="font-family: courier new,courier,monospace;">
<br style="font-family: courier new,courier,monospace;">
<br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">'make
install' copies these files to your pd directory:</span><br
style="font-family: courier new,courier,monospace;">
<br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;"><prefix>/lib/pd/extra/sendVIMS.pd_linux</span><br
style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;"><prefix>/lib/pd/doc/5.reference/help-sendVIMS.pd</span><br
style="font-family: courier new,courier,monospace;">
<br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">the default
<prefix> is /usr/local</span><br
style="font-family: courier new,courier,monospace;">
<br style="font-family: courier new,courier,monospace;">
<br style="font-family: courier new,courier,monospace;">
<br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">running:</span><br
style="font-family: courier new,courier,monospace;">
<br style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">if the module
is in your pd path it will be loaded automaticly.</span></small><br>
</p>
<h2><a name="s3">3. Implementation</a></h2>
<p><span style="font-weight: bold;">3.1 Get veejay running</span><br>
</p>
<p>To start veejay, you need to start it with a video file. Veejay only
plays avi files, so no quicktime, or mpeg movies.<br>
Veejay only knows of two types of video codecs: mjpeg and DV type 2.0. <br>
So to get veejay running, you need at least one mjpeg or DV type 2.0
.avi file. These formats were chosen with some reasons, explained in
the veejay-howto. Converting into codecs and other formats is a whole
science upon itself, and I do intend to write a crash course into video
and linux in the future. For creating mjpeg avi's I use the <a
href="mjpeg.sourceforge.net">lavtools</a> and <a
href="www.mplayerhq.hu">mplayer</a>, and veejay itself.<br>
</p>
<p><a href="http://cola.looze.net/sendvims/video">You can grab a one
second mjpeg avi from here.</a><br>
</p>
<p>This is copyright free material I transcoded out of a movie from <a
href="http://www.archive.org">archive.org</a><br>
Start veejay by opening up a terminal window such as xterm and type: <br>
</p>
<p style="font-family: courier new,courier,monospace;"><small>veejay
mymovie.avi</small></p>
<p>If you used the example one second avi, it will briefly play the
whole movie and stop at the last frame. Move your mouse into the video
window. As long as the mouse pointer is inside the video window, you
can use the built in keyboard controls. press keypad-5, this pauzes
playback. now press keypad-1, to skip to the start of your movie. press
the [ key, this marks 'clip start', press keypad-3, to skip to the end
of the movie, and press the ] key, this marks the 'clip end'. You can
now sellect your clip by pressing the F1 key. the movie will
automatically keep looping. you can alterate loopmode by pressing
keypad-*. try some other keypad keys to see what they do. See 'man
veejay' for the other controls.<br>
</p>
<p><span style="font-weight: bold;">3.2 Running PD/SendVIMS</span><br>
</p>
<p>Open up a terminal window such as xterm and type:<br>
</p>
<p><small style="font-family: courier new,courier,monospace;">pd</small><br>
</p>
<p>You'll need the terminal to get some feedback from pd. From the file
menu of pd, choose 'new'. In the new window, choose 'put > object'. <br>
A rectangular object appears under your mousepointer. Click somewhere
in the white area of the window, and type "sendVIMS" inside the object.
If you installed the sendVIMS external properly, you should read
in the terminal:<br>
</p>
<p><small><span style="font-family: courier new,courier,monospace;">sendVIMS:
version 0.1</span><br
style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">sendVIMS: (c)
2004 Niels Elburg & Tom Schouten</span><br
style="font-family: courier new,courier,monospace;">
<span style="font-family: courier new,courier,monospace;">sendVIMS:
connected to localhost:3490</span></small><br>
</p>
<p>That's it! you should now be able to right-click on the sendVIMS
object, and choose 'help' from the popup window. <br>
You are now properly set up to use sendVIMS and veejay. Please refer to
some of the examples I provide under 'examples' for more information.
You should note that my examples will work right away, even without
understanding PD in the first place, but they are not intended as a
tutorial on how to use PD. you should see the 'help' menu and various
resources around the web for that!.<br>
</p>
<p><br>
</p>
<h2><a name="s4">4. Troubleshooting</a></h2>
<p><span style="font-weight: bold;">
4.1 Veejay doesn't start!</span><br>
</p>
<p>You need to start veejay from a terminal, using a proper encoded avi
file. you can use the <a href="http://cola.looze.net/sendvims/video">demo</a>
file if you don't have one.<br>
Please refer to veejay documentation and maillinglist.<br>
</p>
<p><span style="font-weight: bold;">4.2 SendVIMS doesn't work, PD tells
me it can't create sendvims.</span><br>
</p>
<p>The sendVIMS-0.1 external is not installed. please install the
external and restart PD.<br>
</p>
<p><span style="font-weight: bold;">4.3 I have a different problem,
please help me.</span><br>
</p>
<p>If the problem is relevant to this document please <a
href="mailto:[email protected]">mail</a> me and I'll add it here. Try the
PD and veejay maillinglist otherwise.<br>
</p>
<h2><a name="s5">5. Further Information</a></h2>
<p><span style="font-weight: bold;">5.1 HOWTO's and documentation</span><br>
</p>
<p>The veejay howto can be found here: <a
href="http://veejay.sourceforge.net/veejay-HOWTO.html">http://veejay.sourceforge.net/veejay-HOWTO.html</a><br>
PureData documentation is here: <a
href="http://www.puredata.org">http://www.puredata.org</a><br>
</p>
<p>I have have been working on some more patches besides the ones in
the examples, they're on my personal homepage:<br>
<a href="http://cola.looze.net/sendvims/">http://cola.looze.net/sendvims/</a></p>
<p><br>
<span style="font-weight: bold;">5.2 Email, Mailinglists</span></p>
<p>Please post your questions to the veejay mailinglist, you can
subscribe <a href="http://sourceforge.net/mail/?group_id=47564">here</a>.<br>
<br>
</p>
<h2><a name="s6">6. Examples</a></h2>
<p><span style="font-weight: bold;">6.1 Basic Example: play, play
backwards.</span><br>
</p>
<p>In PD, you send a message by creating a message object, type the
message into that object, and connect the output of the message to the
sendVIMS object.<br>
</p>
<p><img src="VIMS-example-play.jpg" title=""
alt="Screenhost of example patch" style="width: 326px; height: 288px;"><br>
</p>
<p>In this example, I used PD aliasses: video.play.forward, and
video.play.backward. Normally, most VIMS messages are represented as
numbers, preceded by a 'p', for example, p100 stands for 'select and
play sample' followed by an argument. In the following example, you can
select different clips to play in veejay by changing the number inside
the number box. ( you can make diferent clips in veejay when in 'plain
video' mode, by pressing keypad '/'. Use keypad play controls to select
different frame positions, use the [ and ] keys to mark in and
outpoints of clips, use the function keys to select samples with the
keyboard controls).<br>
</p>
<p>6.2 Set the playing clip with an argument.<br>
</p>
<p><img src="VIMS-example-setframe.jpg" title=""
alt="Set the playing clip with an argument"
style="width: 326px; height: 288px;"><br>
</p>
<p>The $1 takes the number from the number box, and together with the
p100 message it gives the command "select and play sample $1" to
veejay. Note, that since PD doesn't know how many clips we have here,
we can select non-existing clips. We can give negative numbers. veejay
will give an error message.<br>
</p>
<p><span style="font-weight: bold;">6.3 Getting status output from
veejay.</span><br>
</p>
<p>This example shows how to get information you need from veejay: for
example the current frame. <br>
</p>
<p><img src="VIMS-example-getstatus.jpg" title=""
alt="Example of getting status information"
style="width: 326px; height: 288px;"><br>
</p>
<p>Now, there are two number boxes. When playing clips, the first
number box will display the current frame, but when playing in plain
video, the second box outputs the current frame. Veejay sends it's
status in one big string of numbers, seperated by spaces. all
information comes in at the same time. You can use the 'unpack' object
to split the information in smaller chunks. notice how many outputs it
has - there are lots of status messages to be read. I have made a patch
that helps me remember what goes where, and I include it as a subpatch
when working with sendVIMS. You can find it on my personal weppage: <a
href="http://cola.looze.net/sendvims">http://cola.looze.net/sendvims</a>.<br>
</p>
<p><span style="font-weight: bold;">6.4 Controlling video effects.</span><br>
</p>
<p>Veejay has many video effects. you can find out what kind of effects
on veejay's homepage, in the gallery section. For this next example,
you need two different clips. Assuming that you are working with the
example movie, press Keypad-5 for pauze, and Keypad-1 to go to the
start of the movie. Mark the beginning of your first clip here. Now, we
gently scrub to frame 12 in the movie using Keypad-9 - it skips one
frame ahead at a time - and mark the end of the first clip, and, on the
same frame, the beginning of the second clip, and at the last frame of
the movie, the end of the second clip( HINT: you could use the
"video.set.frame <frame>" message here instead).<br>
You should have two samples now, which you can select with the F1 and
F2 keys. Lets start with selecting the first clip and have a look at
the example:<br>
</p>
<p><img src="VIMS-example4-videomixer.jpg" title=""
alt="example of effect controls" style="width: 561px; height: 414px;"><br>
</p>
<p>The first message sets up the effect chain. Veejay can chain
multiple effects on top of eachother, like layers in an image editing
program. In this example, it sets effect 4 on current playing sample (
the number zero in the VIMS messages that control effects always stands
for the current playing clip, as a convenience. you could also replace
the number with a variable, and read it from veejay's output to know
the current clip).<br>
Effect 4 is the "Normal Overlay" effect, it simply mixes two video like
a videomixer.<br>
</p>
<p>The second message controls the clip the overlay effect mixes with.
Put it to 2 to mix with our second clip. <br>
The third message is a PD message, that controls the boundaries of the
slider. Normally, sliders have value 0 to 127 by default. the overlay
effect has only one controll, opacity, and it is mesured in value 0 to
255, so I want the slider to have boundaries ranging 0 to 255.<br>
The slider is connected to the third message: control parameter 0 of
the effect on chain-entry 3 of the current playing clip.<br>
The order of these values is typical: first, tell which sample to
select. second, what effect chain entry, third, which control
parameter, and last, the value of that parameter. <br>
You can make a dump of the effects numbers and the VIMS messages by
running:<br>
</p>
<p><small><span style="font-family: courier new,courier,monospace;">veejay
--dump-events -d > veejay-events.txt<br>
</span></small></p>
<p>The last message, "connect localhost 3490" actually (re)connects the
sendVIMS object to veejay if not already connected. You can use the
message "disconnect" and "quit", too, have a look at the sendVIMS
helpfile.<br>
</p>
<p><span style="font-weight: bold;">6.5 More advanced playback control:
scrubbing.</span><br>
</p>
<p>This example shows two things: One slider can be used to set a new
play position in a clip, the other shows the play position in the
current clip.<br>
Both sliders get their boundaries updated with the starting position of
the clip and the ending position. This only works in the 'clip' mode,
not when playing in plain video.<br>
</p>
<p><img src="VIMS-example5-scrubbing.jpg" title=""
alt="Example of controlling play position with a slider"
style="width: 372px; height: 396px;"><br>
</p>
<p>From the status, the starting frame and the end frame of the current
playing clip are read, which sets the boundaries of both sliders. The
slider in the top of the patch controls message p089: set frame $1, the
slider in the bottom gets updated with the 'current frame of clip'
information.<br>
However, when switching from clip to plain video mode, this will no
longer work as the outputs get different status updates. Switching
between clips wil work perfectly however.<br>
</p>
<p>More advanced combinations are possible. PD offers a lot of
functionality, such as MIDI, joystick controls and controlling things
through sound. Some more examples of my work are on my personal
website. <br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
</body>
</html>