Forums > Jitter

multiple movies playing at once

January 11, 2008 | 5:06 pm

I’m new to this program, so a basic question. I simply want to play two or more movies side by side at the same time. Here’s the code I have for the same 320×240 movie playing next to itself, stretched in the vertical direction to fill a 640×480 screen. It doesn’t work. Why?

max v2;
#N vpatcher 122 63 1114 755;
#P origin 47 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 190 294 129 196617 jit.matrix 4 char 640 480;
#P window linecount 2;
#P message 541 169 248 196617 usersrcdim 1 , srcdimstart 0 0 , srcdimend 320 240 , usedstdim 1 , dstdimstart 320 0 , dstdimend 640 480;
#P message 187 167 248 196617 usersrcdim 1 , srcdimstart 0 0 , srcdimend 320 240 , usedstdim 1 , dstdimstart 0 0 , dstdimend 320 480;
#P user jit.pwindow 101 429 322 242 0 1 0 0 1 0;
#P window linecount 1;
#P newex 31 294 129 196617 jit.matrix 4 char 640 480;
#P newex 135 72 48 196617 loadbang;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 1 105 55 1441802 metro 40;
#P toggle 1 57 15 0;
#P message 64 106 34 1441802 read;
#P newex 1 212 172 1441802 jit.qt.movie 320 240 @vol 0;
#B color 5;
#P connect 2 0 3 0;
#P connect 1 0 0 0;
#P connect 3 0 0 0;
#P connect 0 0 5 0;
#P connect 7 0 5 0;
#P connect 4 0 1 0;
#P connect 5 0 6 0;
#P connect 9 0 6 0;
#P connect 4 0 7 0;
#P connect 8 0 9 0;
#P connect 4 0 8 0;
#P pop;


January 11, 2008 | 6:03 pm

Hi Mark, The reason this is not working, is that the second matrix
(the one to the right), is not receiving any matrix data, nor any bangs.

If you use a ‘print’ beneath any objects, you can see what their
output is. A jit.matrix object has a unique name generated for it,
which is really a ‘pointer’ to the matrix data in memory, and when a
matrix, or matrix operator process data, it sends out the name of
this pointer. I know, it sounds weird, but you can do two things here.

1) you can simply wire the output of your movie to the second right
most matrix (patchcoords can go to more than one place)

2) you can NAME the matrix on the right and left, say, mymovie, by
using the @name attribute., so both matrices would be

[jit.matrix 4 char 640 480 @name mymovie]

Giving them both the same name means that they reference the same
data. Now all you have to do is tell them to output, which means
banging them. So you could then connect your metro to the rightmost
matrix.

Both solutions are valid.

:)

Hope that helps.

On Jan 11, 2008, at 12:06 PM, Mark Palmer wrote:

>
> I’m new to this program, so a basic question. I simply want to play
> two or more movies side by side at the same time. Here’s the code I
> have for the same 320×240 movie playing next to itself, stretched in
> the vertical direction to fill a 640×480 screen. It doesn’t work. Why?
>
> max v2;
> #N vpatcher 122 63 1114 755;
> #P origin 47 0;
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P newex 190 294 129 196617 jit.matrix 4 char 640 480;
> #P window linecount 2;
> #P message 541 169 248 196617 usersrcdim 1 , srcdimstart 0 0 ,
> srcdimend 320 240 , usedstdim 1 , dstdimstart 320 0 , dstdimend
> 640 480;
> #P message 187 167 248 196617 usersrcdim 1 , srcdimstart 0 0 ,
> srcdimend 320 240 , usedstdim 1 , dstdimstart 0 0 , dstdimend 320
> 480;
> #P user jit.pwindow 101 429 322 242 0 1 0 0 1 0;
> #P window linecount 1;
> #P newex 31 294 129 196617 jit.matrix 4 char 640 480;
> #P newex 135 72 48 196617 loadbang;
> #P window setfont "Fixedwidth Serif" 10.;
> #P newex 1 105 55 1441802 metro 40;
> #P toggle 1 57 15 0;
> #P message 64 106 34 1441802 read;
> #P newex 1 212 172 1441802 jit.qt.movie 320 240 @vol 0;
> #B color 5;
> #P connect 2 0 3 0;
> #P connect 1 0 0 0;
> #P connect 3 0 0 0;
> #P connect 0 0 5 0;
> #P connect 7 0 5 0;
> #P connect 4 0 1 0;
> #P connect 5 0 6 0;
> #P connect 9 0 6 0;
> #P connect 4 0 7 0;
> #P connect 8 0 9 0;
> #P connect 4 0 8 0;
> #P pop;
>


January 11, 2008 | 6:13 pm

a few things : there was a typo in the matrix copying message , you wrote "usersrcdim 1" instead of "usesrcdim 1" ( happens :) ),

then when combining two matrices together it is necessary to use some matrix operators to create one matrix out of two.
jit.op is the most common one.
jit.concat would do the same thing as your patch, see example.

there are numerous ways to do what you intead to do , i recommand having a look at the openGL objects (jit.gl.videopane as a starter ) which have a little learning curve but will save you lots of CPU as most of the process goes on your graphic card . manipulating, positionning , scaling your images become much easier as well;

welcome in the maze

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 867 116 83 196617 read dishes.mov;
#P newex 809 180 53 196617 jit.concat;
#P user jit.pwindow 808 201 322 242 0 1 0 0 1 0;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 809 114 55 1441802 metro 40;
#P toggle 809 93 15 0;
#P newex 809 147 172 1441802 jit.qt.movie 320 240 @vol 0;
#B color 5;
#P window setfont "Sans Serif" 9.;
#P newex 9 244 134 196617 t l l;
#P newex 110 401 64 196617 jit.op @op +;
#P newex 197 301 129 196617 jit.matrix 4 char 640 480;
#P window linecount 2;
#P message 448 217 248 196617 usesrcdim 1 , srcdimstart 0 0 , srcdimend 319 239 , usedstdim 1 , dstdimstart 319 0 , dstdimend 639 479;
#P message 194 218 243 196617 usesrcdim 1 , srcdimstart 0 0 , srcdimend 319 239 , usedstdim 1 , dstdimstart 0 0 , dstdimend 319 479;
#P user jit.pwindow 108 436 322 242 0 1 0 0 1 0;
#P window linecount 1;
#P newex 38 301 129 196617 jit.matrix 4 char 640 480;
#P newex 194 112 48 196617 loadbang;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 8 112 55 1441802 metro 40;
#P toggle 8 64 15 0;
#P message 67 112 100 1441802 read dishes.mov;
#P newex 8 219 172 1441802 jit.qt.movie 320 240 @vol 0;
#B color 5;
#P window setfont "Sans Serif" 9.;
#P comment 857 87 100 196617 this does the same;
#P connect 5 0 8 0;
#P connect 5 0 9 0;
#P connect 13 0 17 0;
#P connect 13 0 17 1;
#P connect 17 0 16 0;
#P connect 15 0 13 0;
#P connect 14 0 15 0;
#P connect 18 0 13 0;
#P connect 6 0 11 0;
#P connect 12 0 6 0;
#P connect 1 0 12 0;
#P connect 12 1 10 0;
#P connect 10 0 11 1;
#P connect 11 0 7 0;
#P connect 9 0 10 0;
#P connect 8 0 6 0;
#P connect 4 0 1 0;
#P connect 2 0 1 0;
#P connect 3 0 4 0;
#P window clipboard copycount 19;

Quote: mpalmer wrote on Fri, 11 January 2008 18:06
—————————————————-
> I’m new to this program, so a basic question. I simply want to play two or more movies side by side at the same time. Here’s the code I have for the same 320×240 movie playing next to itself, stretched in the vertical direction to fill a 640×480 screen. It doesn’t work. Why?
>
> max v2;
> #N vpatcher 122 63 1114 755;
> #P origin 47 0;
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P newex 190 294 129 196617 jit.matrix 4 char 640 480;
> #P window linecount 2;
> #P message 541 169 248 196617 usersrcdim 1 , srcdimstart 0 0 , srcdimend 320 240 , usedstdim 1 , dstdimstart 320 0 , dstdimend 640 480;
> #P message 187 167 248 196617 usersrcdim 1 , srcdimstart 0 0 , srcdimend 320 240 , usedstdim 1 , dstdimstart 0 0 , dstdimend 320 480;
> #P user jit.pwindow 101 429 322 242 0 1 0 0 1 0;
> #P window linecount 1;
> #P newex 31 294 129 196617 jit.matrix 4 char 640 480;
> #P newex 135 72 48 196617 loadbang;
> #P window setfont "Fixedwidth Serif" 10.;
> #P newex 1 105 55 1441802 metro 40;
> #P toggle 1 57 15 0;
> #P message 64 106 34 1441802 read;
> #P newex 1 212 172 1441802 jit.qt.movie 320 240 @vol 0;
> #B color 5;
> #P connect 2 0 3 0;
> #P connect 1 0 0 0;
> #P connect 3 0 0 0;
> #P connect 0 0 5 0;
> #P connect 7 0 5 0;
> #P connect 4 0 1 0;
> #P connect 5 0 6 0;
> #P connect 9 0 6 0;
> #P connect 4 0 7 0;
> #P connect 8 0 9 0;
> #P connect 4 0 8 0;
> #P pop;
>
—————————————————-


January 11, 2008 | 6:14 pm

Thanks! I did leave out that line and now it works, somewhat. It seems to be alternating frames, which means it’s very strobe-y. Can that be fixed? Is there a better way to play two or more movies side by side?


January 12, 2008 | 1:43 am

Actually, I resized the output movie and it doesn’t seem to work anymore. I can’t resize to 1280×720 and keep both movies showing on the screen for some reason, even though they’re only 320×240 each. Any idea why?

max v2;
#N vpatcher 21 54 1143 742;
#P origin 38 0;
#P window setfont "Sans Serif" 9.;
#P newex 168 386 129 196617 jit.matrix 4 char 320 240;
#P message 447 143 248 196617 usedstdim 1 , dstdimstart 80 60 , dstdimend 160 120;
#P message 205 99 224 196617 usedstdim 1 , dstdimstart 0 0 , dstdimend 80 60;
#P user jit.pwindow 122 426 322 242 0 1 0 0 1 0;
#P newex 1 385 129 196617 jit.matrix 4 char 320 240;
#P newex 144 72 48 196617 loadbang;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 10 105 55 1441802 metro 40;
#P toggle 10 57 15 0;
#P message 73 106 34 1441802 read;
#P newex 10 212 172 1441802 jit.qt.movie 320 240 @vol 0;
#B color 5;
#P connect 0 0 5 0;
#P connect 7 0 5 0;
#P connect 2 0 3 0;
#P connect 3 0 0 0;
#P connect 1 0 0 0;
#P connect 4 0 1 0;
#P connect 5 0 6 0;
#P connect 9 0 6 0;
#P connect 8 0 9 0;
#P connect 0 0 9 0;
#P connect 4 0 7 0;
#P connect 4 0 8 0;
#P pop;


January 12, 2008 | 1:48 am

Also, a search through the documentation turns up nothing on jit.gl.videopane. Even a web search produces nil.


January 12, 2008 | 1:52 am

jit.gl.videoplane, with an l, like the thing that flies.

On Jan 11, 2008, at 8:48 PM, Mark Palmer wrote:

>
> Also, a search through the documentation turns up nothing on
> jit.gl.videopane. Even a web search produces nil.
>


January 12, 2008 | 5:53 am

Okay, thanks all! I’ve looked over jit.gl.videoplane, and it definitely seems like the way to go.

max v2;
#N vpatcher 411 232 1010 752;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 279 289 75 196617 jit.window foo;
#P window linecount 3;
#P newex 274 235 113 196617 jit.gl.videoplane foo @position 0.3 0.6 0 @scale 0.25 0.25 0.25;
#P window linecount 1;
#P newex 130 240 82 196617 jit.gl.render foo;
#P newex 282 195 111 196617 jit.qt.movie 1280 720;
#P message 282 143 30 196617 read;
#P newex 94 151 58 196617 t b erase b;
#P newex 97 115 57 196617 qmetro 20;
#P number 144 54 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 83 55 15 0;
#P connect 2 0 3 0;
#P connect 0 0 2 0;
#P connect 3 1 6 0;
#P connect 3 0 6 0;
#P connect 1 0 2 1;
#P connect 5 0 7 0;
#P connect 3 2 5 0;
#P connect 4 0 5 0;
#P pop;


January 12, 2008 | 6:26 am

Okay, so one thing I can’t figure out with jit.gl.videoplane is how to get positioning correct within the space. For instance, let’s say I want to put a 320×240 video in the upper left hand corner in a 1280×720 space. What @position #s do I use, and why? I played around with numbers at random below and finally got it to work, but they are weird #s like 0.525 that make no sense in relation to the .33x.25 scaling. It would be nice if it made more sense. Does anybody know?

max v2;
#N vpatcher 322 256 921 776;
#P window setfont "Sans Serif" 9.;
#P message 139 288 95 196617 rect 0 0 1280 720;
#P newex 135 325 75 196617 jit.window foo;
#P newex 283 234 292 196617 jit.gl.videoplane foo @position -1.145 0.525 0 @scale 0.33 0.25 0;
#P newex 130 240 82 196617 jit.gl.render foo;
#P newex 282 195 105 196617 jit.qt.movie 320 240;
#P message 282 143 30 196617 read;
#P newex 94 151 58 196617 t b erase b;
#P newex 97 115 57 196617 qmetro 20;
#P number 144 54 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 83 55 15 0;
#P connect 2 0 3 0;
#P connect 0 0 2 0;
#P connect 3 0 6 0;
#P connect 3 1 6 0;
#P connect 9 0 8 0;
#P connect 1 0 2 1;
#P connect 3 2 5 0;
#P connect 4 0 5 0;
#P connect 5 0 7 0;
#P pop;


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