Forums > Jitter

motion tracking to playback a movie

May 1, 2007 | 6:43 pm

Hi,

I am currently doing a video installation,
which is need to tracking the direction of the motion,
and then play a movie by its direction.

say for a example,
if someone is moving to the left, the video will play forward,
and if someone is moving to the right, the video will play backward.

How to make it well? I am concerning using photo squence or using a video clip for the footage.

many thanks.


May 1, 2007 | 7:27 pm


May 3, 2007 | 4:16 pm

I have patched together a couple of different patches as an example of how you can do this.

The motion tracker is pulled from a jitterRecipe called motionto midi, it is an efficient tracker. To understand how this works, look at the motion to midi article in the in-depth page on this site (under articles).

Then look at the jit.scissors object,
then look at the bucket object,
then look at the "< " and the ">" objects,
and then the counter,
and then the jit.qt.movie….

max v2;
#N vpatcher 20 74 1204 699;
#P origin 15 -7;
#P window setfont "Sans Serif" 9.;
#P window linecount 2;
#P comment 572 116 110 196617 bang when past this # (global;
#P flonum 532 115 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 471 516 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 471 534 50 196617 frame $1;
#P window setfont "Fixedwidth Serif" 10.;
#P message 675 459 14 1441802 1;
#P message 643 459 14 1441802 0;
#P message 598 418 38 1441802 start;
#P message 638 417 32 1441802 stop;
#P newex 642 479 64 1441802 qmetro 40;
#P toggle 658 459 15 0;
#P message 561 419 34 1441802 read;
#P newex 470 558 130 1441802 jit.qt.movie 640 480;
#B color 5;
#P window setfont "Sans Serif" 9.;
#N counter;
#X flags 0 0;
#P newobj 471 497 66 196617 counter;
#P button 1000 239 15 0;
#P button 914 238 15 0;
#P comment 887 185 110 196617 bang when past this #;
#P flonum 999 184 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 178 444 778 844;
#P inlet 173 65 15 0;
#N comlet amount of mvmt;
#P outlet 305 271 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 340 222 40 196617 split;
#N comlet split;
#P outlet 373 264 15 0;
#P flonum 218 147 56 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 165 241 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 165 286 15 0;
#P message 165 217 39 196617 set $1;
#P newex 209 275 29 196617 past;
#N comlet set past;
#P inlet 165 161 15 0;
#N comlet past;
#P outlet 209 308 15 0;
#P window linecount 1;
#P newex 176 110 53 196617 jit.3m;
#P connect 2 0 4 0;
#P connect 4 0 6 0;
#P connect 3 0 5 0;
#P connect 11 0 0 0;
#P fasten 7 0 3 0 223 218 214 218;
#P connect 4 0 3 0;
#P connect 3 0 1 0;
#P connect 0 1 7 0;
#P fasten 7 0 10 0 223 216 310 216;
#P fasten 7 0 9 0 223 196 345 196;
#P connect 2 0 9 2;
#P connect 9 1 8 0;
#P pop;
#P newobj 914 213 97 196617 p motiontrackerpt2;
#P comment 894 167 100 196617 amount of mvmt.;
#P flonum 999 166 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 914 260 14 196617 4;
#P button 843 238 15 0;
#P button 757 237 15 0;
#P comment 730 184 110 196617 bang when past this #;
#P flonum 842 183 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 178 444 778 844;
#P inlet 173 65 15 0;
#N comlet amount of mvmt;
#P outlet 305 271 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 340 222 40 196617 split;
#N comlet split;
#P outlet 373 264 15 0;
#P flonum 218 147 56 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 165 241 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 165 286 15 0;
#P message 165 217 39 196617 set $1;
#P newex 209 275 29 196617 past;
#N comlet set past;
#P inlet 165 161 15 0;
#N comlet past;
#P outlet 209 308 15 0;
#P window linecount 1;
#P newex 176 110 53 196617 jit.3m;
#P connect 2 0 4 0;
#P connect 4 0 6 0;
#P connect 3 0 5 0;
#P connect 11 0 0 0;
#P fasten 7 0 3 0 223 218 214 218;
#P connect 4 0 3 0;
#P connect 3 0 1 0;
#P connect 0 1 7 0;
#P fasten 7 0 10 0 223 216 310 216;
#P fasten 7 0 9 0 223 196 345 196;
#P connect 2 0 9 2;
#P connect 9 1 8 0;
#P pop;
#P newobj 757 212 97 196617 p motiontrackerpt2;
#P comment 737 166 100 196617 amount of mvmt.;
#P flonum 842 165 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 757 259 14 196617 3;
#P button 689 238 15 0;
#P button 603 237 15 0;
#P comment 576 184 110 196617 bang when past this #;
#P flonum 688 183 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 178 444 778 844;
#P inlet 173 65 15 0;
#N comlet amount of mvmt;
#P outlet 305 271 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 340 222 40 196617 split;
#N comlet split;
#P outlet 373 264 15 0;
#P flonum 218 147 56 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 165 241 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 165 286 15 0;
#P window linecount 0;
#P message 165 217 39 196617 set $1;
#P newex 209 275 29 196617 past;
#N comlet set past;
#P inlet 165 161 15 0;
#N comlet past;
#P outlet 209 308 15 0;
#P window linecount 1;
#P newex 176 110 53 196617 jit.3m;
#P connect 2 0 4 0;
#P connect 4 0 6 0;
#P connect 3 0 5 0;
#P connect 11 0 0 0;
#P fasten 7 0 3 0 223 218 214 218;
#P connect 4 0 3 0;
#P connect 3 0 1 0;
#P connect 0 1 7 0;
#P fasten 7 0 10 0 223 216 310 216;
#P fasten 7 0 9 0 223 196 345 196;
#P connect 2 0 9 2;
#P connect 9 1 8 0;
#P pop;
#P newobj 603 212 97 196617 p motiontrackerpt2;
#P comment 583 166 100 196617 amount of mvmt.;
#P flonum 688 165 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 532 232 15 0;
#P message 603 259 14 196617 2;
#P message 446 254 14 196617 1;
#P button 446 228 15 0;
#P comment 421 186 110 196617 bang when past this #;
#P flonum 533 185 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 470 436 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 503 384 15 0;
#P toggle 451 384 15 0;
#P user jit.pwindow 360 182 44 110 0 1 0 0 1 0;
#P user jit.pwindow 314 182 44 110 0 1 0 0 1 0;
#P user jit.pwindow 268 182 44 110 0 1 0 0 1 0;
#P user jit.pwindow 223 182 44 110 0 1 0 0 1 0;
#P newex 224 139 161 196617 jit.scissors @rows 1 @columns 4;
#N vpatcher 178 444 778 844;
#P inlet 173 65 15 0;
#N comlet amount of mvmt;
#P outlet 305 271 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 340 222 40 196617 split;
#N comlet split;
#P outlet 373 264 15 0;
#P flonum 218 147 56 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 165 241 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 165 286 15 0;
#P window linecount 0;
#P message 165 217 39 196617 set $1;
#P newex 209 275 29 196617 past;
#N comlet set past;
#P inlet 165 161 15 0;
#N comlet past;
#P outlet 209 308 15 0;
#P window linecount 1;
#P newex 176 110 53 196617 jit.3m;
#P connect 2 0 4 0;
#P connect 4 0 6 0;
#P connect 3 0 5 0;
#P connect 11 0 0 0;
#P fasten 7 0 3 0 223 218 214 218;
#P connect 4 0 3 0;
#P connect 3 0 1 0;
#P connect 0 1 7 0;
#P fasten 7 0 10 0 223 216 310 216;
#P fasten 7 0 9 0 223 196 345 196;
#P connect 2 0 9 2;
#P connect 9 1 8 0;
#P pop;
#P newobj 446 206 97 196617 p motiontrackerpt2;
#P newex 446 314 48 196617 bucket 2;
#P newex 495 351 27 196617 >;
#P newex 451 353 27 196617 < ;
#P user jit.pwindow 157 183 44 110 0 1 0 0 1 0;
#P user jit.pwindow 111 183 44 110 0 1 0 0 1 0;
#P user jit.pwindow 65 183 44 110 0 1 0 0 1 0;
#P user jit.pwindow 20 183 44 110 0 1 0 0 1 0;
#P newex 26 140 161 196617 jit.scissors @rows 1 @columns 4;
#P comment 314 51 70 196617 set threshold;
#P comment 428 168 100 196617 amount of mvmt.;
#P flonum 325 67 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 533 167 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 206 50 46 196617 settings;
#B color 9;
#N vpatcher 178 444 778 844;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P comment 82 114 175 196617 drops rgb all video in alpha channel;
#P window linecount 2;
#P comment 106 133 162 196617 trigger list list , compares second frame against the first;
#N comlet past;
#P outlet 46 272 15 0;
#P inlet 124 88 15 0;
#P inlet 21 75 15 0;
#P window linecount 1;
#P comment 195 211 69 196617 reduce flicker;
#P newex 16 233 106 196617 jit.op @op > @val 0.3;
#P newex 16 210 178 196617 jit.slide @slide_up 2 @slide_down 10;
#P flonum 112 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 16 188 106 196617 jit.op @op > @val 0.2;
#P newex 15 113 66 196617 jit.rgb2luma;
#P newex 16 162 89 196617 jit.op @op absdiff;
#P newex 15 134 90 196617 t l l;
#P comment 147 170 68 196617 set threshold;
#P connect 9 0 3 0;
#P connect 3 0 1 0;
#P connect 1 1 2 0;
#P connect 2 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 11 0;
#P connect 1 0 2 1;
#P connect 10 0 5 0;
#P connect 5 0 4 1;
#P pop;
#P newobj 250 95 121 196617 p yeoldmotiontrackerpt1;
#P toggle 82 24 15 0;
#P newex 82 50 52 196617 metro 50;
#P message 139 50 28 196617 open;
#B color 9;
#P message 172 50 31 196617 close;
#B color 9;
#P newex 83 72 98 196617 jit.qt.grab 320 240;
#P connect 11 0 12 0;
#P connect 0 0 11 0;
#P connect 11 1 13 0;
#P connect 4 0 3 0;
#P connect 3 0 0 0;
#P connect 2 0 0 0;
#P connect 1 0 0 0;
#P connect 6 0 0 0;
#P connect 11 2 14 0;
#P connect 11 3 15 0;
#P connect 5 0 20 0;
#P connect 20 0 21 0;
#P connect 0 0 5 0;
#P connect 20 1 22 0;
#P connect 20 2 23 0;
#P connect 8 0 5 1;
#P connect 20 3 24 0;
#P fasten 20 0 19 0 229 162 451 162;
#P connect 19 0 30 0;
#P connect 30 0 31 0;
#P fasten 49 0 18 0 919 294 451 294;
#P fasten 41 0 18 0 762 294 451 294;
#P fasten 32 0 18 0 608 294 451 294;
#P connect 31 0 18 0;
#P connect 18 0 16 0;
#P connect 16 0 25 0;
#P connect 18 1 16 1;
#P connect 26 0 27 0;
#P fasten 63 0 58 0 603 549 475 549;
#P fasten 62 0 58 0 643 549 475 549;
#P fasten 61 0 58 0 647 550 475 550;
#P connect 66 0 58 0;
#P fasten 59 0 58 0 566 548 475 548;
#P connect 61 0 57 0;
#P connect 57 0 67 0;
#P connect 67 0 66 0;
#P connect 27 0 57 1;
#P connect 18 0 17 0;
#P connect 17 0 26 0;
#P connect 18 1 17 1;
#P connect 19 2 33 0;
#P connect 19 1 7 0;
#P connect 68 0 28 0;
#P connect 28 0 19 1;
#P fasten 20 1 36 0 266 163 608 163;
#P connect 36 0 39 0;
#P connect 39 0 32 0;
#P connect 60 0 61 0;
#P connect 62 0 64 0;
#P connect 64 0 60 0;
#P connect 65 0 60 0;
#P connect 63 0 65 0;
#P connect 36 1 34 0;
#P fasten 68 0 37 0 537 156 693 156;
#P connect 36 2 40 0;
#P connect 37 0 36 1;
#P fasten 20 2 44 0 303 163 762 163;
#P connect 44 0 47 0;
#P connect 47 0 41 0;
#P connect 44 1 42 0;
#P fasten 68 0 45 0 537 156 847 156;
#P connect 44 2 48 0;
#P connect 45 0 44 1;
#P fasten 20 3 52 0 340 163 919 163;
#P connect 52 0 55 0;
#P connect 55 0 49 0;
#P connect 52 1 50 0;
#P fasten 68 0 53 0 537 157 1004 157;
#P connect 52 2 56 0;
#P connect 53 0 52 1;
#P pop;


Viewing 3 posts - 1 through 3 (of 3 total)