[jitter] lua gencoord
(())_n
kinomatic at gmail.com
Thu Oct 25 01:20:20 MDT 2007
- Previous message: [jitter] lua gencoord
- Next message: [jitter] jit.qt.movie gworld error
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Oct 25, 2007, at 2:03 AM, MarkDavid Hosale wrote : > here's a simple lua slab patch that seems to have better results > than your previous example in terms of the long movie frame rate > thing. I am not sure if there is any advantage to creating the > jit.qt.movie object in lua over max other than for clarity in your > script. I'm not doing it here. I tried to make this patch real > simple so you could build up from it and test as you go. You could > bypass slab, use the uyvy colormode, etc. for example. > > I found the glvideotrail.lua example real useful when learning the > video texturing. > > BTW, I am by far no expert, and maybe you know this already, but > you mentioned separating the cpu and gpu. As I understand it all > the quicktime stuff and most matrix stuff is cpu unless you move it > to the gpu via slab. OpenGL and shaders are gpu. I did notice some > new graphics cards that are handling quicktime calls, but I think > that is a separate issue. > >> Sorry to tear up the bandwidth with this. > > seems to me that's what this list is for... > > Anyway, I hope this patch helps. shoot more questions, and post > more examples, I find this discussion really useful- > -MarkDavid cool. I feel now (tomorrow) I am ready to start to deal simply with GPU issues in jit.gl.lua. I will look at the glvideotrail.lua again tomorrow. I made one more attempt using jit.matrix instances within jit.gl.lua and then using the importmovie message to load still pictures. Problem with reading them directly into the jit.matrix is I cannot specify colormode uvyv. This is why I didn't bring them to a videoplane yet. It seems to work though, but I only tested with 20 images. I haven't gotten into the memsize attribute. Also I was having a bit of trouble outputting an int in another outlet than the first. It came out as lists with just one float element. Find it below or on the site: http://home.earthlink.net/~posit/lua/ cheers, (())_n -- lua code es.matrix.lua autogarbage = 1 autowatch = 1 gc = 1 vmatrix = {} vmatrixnum = 0 current = 0 function bang() current = current + 1 if (current > vmatrixnum) then current = 1 end if (vmatrixnum > 0) then outlet(0, "jit_matrix", vmatrix[current].name) end end function play(i) if (i <= vmatrixnum) then outlet(0, "jit_matrix", vmatrix[i].name) end end function read(a) local temp = vmatrixnum + 1 vmatrix[temp] = jit.matrix(4, "char", 320, 240) vmatrix[temp].adapt = 1 vmatrix[temp]:importmovie(a) vmatrixnum = temp end function path(b) vmatrixnum = 0 current = 0 vmatrix = {} vpath = b end function readfolder(c) local temp = vmatrixnum + 1 vmatrix[temp] = jit.matrix(4, "char", 320, 240) vmatrix[temp].adapt = 1 vmatrix[temp]:importmovie(vpath..c) vmatrixnum = temp end function clear() vmatrixnum = 0 current = 0 vmatrix = {} end Max patch: #P window setfont "Sans Serif" 9.; #P window linecount 1; #P message 90 140 33 196617 clear; #P newex 310 93 39 196617 r slide; #N vpatcher 457 209 884 558; #P window setfont "Sans Serif" 9.; #P window linecount 0; #P newex 75 233 51 196617 tosymbol; #P hidden newex 318 245 39 196617 s slide; #P hidden message 318 221 83 196617 setminmax 1 \$1; #P newex 209 115 48 196617 loadbang; #P window linecount 1; #P newex 75 268 68 196617 prepend read; #P window linecount 0; #P newex 75 121 38 196617 gate 2; #P window linecount 1; #P newex 180 84 21 196617 t 2; #P window linecount 0; #P newex 151 84 21 196617 t 1; #P newex 151 54 69 196617 sel JPEG fold; #P inlet 151 28 15 0; #P window linecount 1; #P newex 257 242 51 196617 tosymbol; #P newex 257 269 67 196617 prepend path; #P newex 152 241 51 196617 tosymbol; #P newex 152 180 37 196617 folder; #P newex 152 151 27 196617 t l l; #P newex 152 211 67 196617 route append; #P message 209 148 61 196617 types JPEG; #P newex 152 268 95 196617 prepend readfolder; #P inlet 103 27 15 0; #P outlet 152 299 15 0; #P connect 12 0 14 0; #P connect 13 0 14 0; #P connect 14 0 19 0; #P connect 19 0 15 0; #P connect 1 0 14 1; #P connect 10 0 11 0; #P connect 11 0 12 0; #P connect 14 1 5 0; #P connect 3 0 6 0; #P connect 5 0 6 0; #P connect 6 0 4 0; #P connect 4 0 7 0; #P connect 7 0 2 0; #P fasten 8 0 0 0 262 291 157 291; #P connect 2 0 0 0; #P connect 15 0 0 0; #P connect 11 1 13 0; #P connect 16 0 3 0; #P connect 5 1 9 0; #P connect 9 0 8 0; #P connect 6 1 17 0; #P hidden connect 17 0 18 0; #P pop; #P newobj 34 139 43 196617 p parse; #P comment 328 126 92 196617 3. - shuffle manual; #P user multiSlider 199 118 125 28 1. 20. 1 2664 47 0 0 2 0 0 0; #M frgb 0 0 0; #M brgb 255 255 255; #M rgb2 127 127 127; #M rgb3 0 0 0; #M rgb4 37 52 91; #M rgb5 74 105 182; #M rgb6 112 158 18; #M rgb7 149 211 110; #M rgb8 187 9 201; #M rgb9 224 62 37; #M rgb10 7 114 128; #P message 199 152 44 196617 play \$1; #P comment 155 94 132 196617 2 - turn on metro to shuffle; #P user jit.pwindow 104 266 322 242 0 1 0 0 1 0; #P user jit.fpsgui 34 250 60 196617 0; #P newex 34 180 64 196617 prepend call; #P toggle 136 92 15 0; #P newex 136 122 57 196617 qmetro 20; #P newex 34 205 167 196617 jit.gl.lua movie @file es.matrix.lua; #P comment 122 66 174 196617 1. - drop folder or jpeg images here; #P comment 297 206 37 196617 (())_n; #P user dropfile 34 52 113 118 1; #P connect 3 0 7 0; #P fasten 3 0 8 0 39 233 110 233; #P connect 11 0 10 0; #P fasten 14 0 11 0 315 114 204 114; #P connect 5 0 4 0; #P fasten 0 1 13 1 108 128 72 128; #P connect 6 0 3 0; #P connect 13 0 6 0; #P fasten 10 0 6 0 204 169 39 169; #P fasten 4 0 6 0 141 169 39 169; #P fasten 15 0 6 0 95 169 39 169; #P connect 0 0 13 0; #P window clipboard copycount 16;
- Previous message: [jitter] lua gencoord
- Next message: [jitter] jit.qt.movie gworld error
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
