reading multiple recorded videos with generic name and more

Apr 23, 2008 at 6:50am

reading multiple recorded videos with generic name and more

Hello there,

My task is as follows:

I need to record live video feed, up to 1 min worth, save that to hdd with a generic name (this I have already created a patch for thanks to help of this forum) but my next step is to pull up that video and then play it on loop. (I will do other things as well, but this is the basic overall concept of what I need to achieve, and the part that I am stuck on). Once that has been achieved for one video, I will need to achieve this for an unlimited amount of files – but for now lets say 4 videos. Becuase the plan is that my sensor will set off the recording and record a max of 1 min, then this is to be played (outputed on projector) (either immediately or delayed – not too important at the moment) on a loop. Each time a new video is recorded, i want to add it to my set of video being played. I would like to get the scissors and glue patch to do this. What I mean is that say the first video plays in position top left, and then when a second video is generated, it takes over position top left and pushed the first video to the next position for arguments sake be that top right (as the generic scissors and glue patch divides it up into four sections).

There is a lot here to contemplate, but if I can get the basic framework working, then i will be able to modify it later.

Just for testing purposes I havnt worried about the sensor at the moment I just have a toggle to turn on and off the live feed and to stop start the recording. within the recording section I have been able to generate a generic name for the file and each time a recording is done, it creates a new name.

I guess the first thing I need help with is a patch that will store the generic names so that it can later be read by a patch that will replay the video… I hope this isnt too confusing. Once I figure that out then the next step will be to set it up so the videos that are being played are sent to the jit.glue patch and are stiched together, each time moving them one position as a new video is played……………!

here is my current patch to work from

ANY help is appreciated and like all projects are working on a deadline!

Thanks so much (even if u direct me to help tutorials or threads that already talk about this)

Thanks
Robert

#37086
Apr 23, 2008 at 6:51am

here is the patch

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 565 51 118 9109513 Starts and stops recording;
#P number 1114 195 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 1075 195 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 1036 219 89 9109513 pak dim 320 240;
#P number 942 254 21 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 918 254 21 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 894 254 21 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 870 254 21 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 846 277 108 9109513 pak planemap 0 1 2 3;
#P number 1111 254 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 1074 254 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 1037 254 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 1000 254 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 963 279 160 9109513 pak dstrect 0 0 320 240;
#P number 1154 145 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 1117 145 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 1080 145 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 1043 145 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 1006 169 160 9109513 pak dstrect 0 0 320 240;
#P newex 826 318 73 9109513 s recordeditinfo;
#P newex 600 442 71 9109513 r recordeditinfo;
#P message 869 115 52 9109513 getflatten;
#P message 1028 114 45 9109513 flatten 0;
#P message 822 116 39 9109513 gethint;
#P message 929 115 91 9109513 flatten 1 faststart;
#P message 820 366 52 9109513 getflatten;
#P newex 488 97 48 9109513 r livefeed;
#P newex 20 355 48 9109513 r livefeed;
#P newex 63 201 50 9109513 s livefeed;
#P message 979 365 45 9109513 flatten 0;
#P message 736 96 40 9109513 hint $1;
#P message 773 367 39 9109513 gethint;
#P message 671 96 61 9109513 realtime $1;
#P newex 652 508 30 9109513 print;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 603 395 38 9240586 print;
#P window setfont “Sans Serif” 9.;
#P newex 592 364 94 9109513 append 30. jpeg high;
#P message 1036 365 38 9109513 getdim;
#N vpatcher 50 40 538 189;
#P window setfont “Sans Serif” 9.;
#P comment 9 9 456 9109513 //codec types ; raw , cinepak , graphics , animation , video , componentvideo , jpeg , mjpega , mjpegb , sgi , planarrgb , macpaint , gif , photocd , qdgx , avrjpeg , opendmljpeg , bmp , winraw , vector , qd , h261 , h263 , dvntsc , dvpal , dvprontsc , dvpropal , flc , targa , png , tiff , componentvideosigned , componentvideounsigned , cmyk , microsoft , sorenson , indeo4 , argb64 , rgb48 , alphagrey32 , grey16 , mpegyuv420 , yuv420 , sorensonyuv9 ; ; //codec qualities ; lossless , max , min , low , normal , high ;;
#P pop;
#P newobj 690 364 64 9109513 p codec_info;
#P comment 586 347 335 9109513 ;
#P number 970 146 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 933 146 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 896 146 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 859 146 35 9 0 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 822 169 160 9109513 pak srcrect 0 0 320 240;
#P toggle 955 200 15 0;
#P message 955 223 71 9109513 usedstrect $1;
#P toggle 879 201 15 0;
#P message 879 224 72 9109513 usesrcrect $1;
#P toggle 824 200 15 0;
#P message 824 224 50 9109513 interp $1;
#P user gswitch2 459 155 39 32 0 0;
#P user jit.pwindow 570 532 162 122 0 1 0 0 1 0;
#P message 539 331 26 9109513 stop;
#P newex 546 95 122 9109513 if $i1==1 then 1 else out2 0;
#P toggle 546 52 15 0;
#P number 618 249 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 582 249 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 546 249 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 546 227 82 9109513 unpack 0 0 0;
#P newex 546 140 53 9109513 t date time;
#P newex 592 297 216 9109513 sprintf symout vid-%ld-%ld-%ld.%ld-%ld-%ld.mov;
#P number 733 248 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 697 248 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 661 248 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 661 226 82 9109513 unpack 0 0 0;
#P newex 546 175 40 9109513 date;
#B color 5;
#P newex 571 481 91 9109513 jit.qt.record 320 240;
#P newex 592 325 63 9109513 prepend write;
#P window setfont “Fixedwidth Serif” 10.;
#P message 174 105 38 9240586 close;
#P window setfont “Sans Serif” 9.;
#P newex 62 70 122 9109513 if $i1==1 then 1 else out2 0;
#P user jit.pwindow 19 404 322 242 0 1 0 0 1 0;
#P toggle 62 36 15 0;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 5 70 50 9240586 metro 2;
#P message 62 104 32 9240586 open;
#P newex 62 161 122 9240586 jit.dx.grab 320 240;
#P window setfont “Sans Serif” 9.;
#P message 880 366 91 9109513 flatten 1 faststart;
#P comment 85 36 100 9109513 Grabs live video feed;
#P fasten 41 0 10 0 597 389 576 389;
#P fasten 41 0 42 0 597 389 608 389;
#P fasten 5 0 4 0 67 62 10 62;
#P connect 49 0 6 0;
#P connect 5 0 7 0;
#P connect 7 0 3 0;
#P fasten 4 0 2 0 10 142 67 142;
#P fasten 8 0 2 0 179 142 67 142;
#P connect 3 0 2 0;
#P fasten 2 0 48 0 68 181;
#P connect 7 1 8 0;
#P fasten 22 0 26 0 551 82 464 82;
#P connect 50 0 26 1;
#P fasten 23 1 24 0 663 129 526 129 526 318 544 318;
#P connect 22 0 23 0;
#P connect 23 0 17 0;
#P fasten 17 1 11 0 594 167 551 167;
#P connect 17 0 11 0;
#P connect 11 0 18 0;
#P connect 18 0 19 0;
#P fasten 40 0 10 0 1041 439 576 439;
#P fasten 56 0 10 0 605 470 576 470;
#P fasten 47 0 10 0 984 439 576 439;
#P fasten 1 0 10 0 885 439 576 439;
#P fasten 51 0 10 0 825 439 576 439;
#P fasten 46 0 10 0 741 129 526 129 526 397 576 397;
#P fasten 45 0 10 0 778 439 576 439;
#P fasten 44 0 10 0 676 129 526 129 526 397 576 397;
#P fasten 26 1 10 0 493 397 576 397;
#P fasten 24 0 10 0 544 359 576 359;
#P connect 10 0 25 0;
#P connect 18 1 20 0;
#P fasten 21 0 16 0 623 293 597 293;
#P connect 16 0 9 0;
#P connect 9 0 41 0;
#P connect 18 2 21 0;
#P fasten 19 0 16 1 551 284 638 284;
#P connect 10 1 43 0;
#P fasten 11 1 12 0 566 211 666 211;
#P connect 12 0 13 0;
#P fasten 22 0 44 0 551 82 676 82;
#P fasten 20 0 16 2 587 284 679 284;
#P connect 12 1 14 0;
#P fasten 13 0 16 3 666 276 720 276;
#P connect 12 2 15 0;
#P fasten 22 0 46 0 551 82 741 82;
#P fasten 14 0 16 4 702 276 761 276;
#P fasten 15 0 16 5 737 262 737 276 802 276;
#P connect 28 0 27 0;
#P fasten 54 0 57 0 1033 139 812 139 812 280 831 280;
#P fasten 52 0 57 0 934 138 811 138 811 274 831 274;
#P fasten 55 0 57 0 874 141 811 141 811 278 831 278;
#P fasten 53 0 57 0 827 160 813 160 813 280 831 280;
#P fasten 58 0 57 0 1011 194 819 194 819 277 831 277;
#P fasten 33 0 57 0 827 194 818 194 818 274 831 274;
#P fasten 27 0 57 0 829 256 831 256;
#P fasten 29 0 57 0 884 247 831 247;
#P fasten 31 0 57 0 960 248 831 248;
#P fasten 63 0 57 0 968 305 831 305;
#P fasten 68 0 57 0 851 304 831 304;
#P fasten 73 0 57 0 1041 247 831 247;
#P connect 34 0 33 1;
#P connect 69 0 68 1;
#P connect 30 0 29 0;
#P connect 70 0 68 2;
#P connect 35 0 33 2;
#P connect 71 0 68 3;
#P connect 36 0 33 3;
#P connect 72 0 68 4;
#P connect 32 0 31 0;
#P connect 37 0 33 4;
#P connect 64 0 63 1;
#P connect 65 0 63 2;
#P connect 59 0 58 1;
#P connect 66 0 63 3;
#P connect 74 0 73 1;
#P connect 60 0 58 2;
#P connect 67 0 63 4;
#P connect 75 0 73 2;
#P connect 61 0 58 3;
#P connect 62 0 58 4;
#P window clipboard copycount 77;

#127710
Apr 23, 2008 at 4:46pm

looks like you’ve done most of the work already.
just check out the coll object to store the file names in.

#127711
Apr 24, 2008 at 4:42am

thanks for that rob

im jsut not sure how to get it to input the filve name – ive givin it a fews goes, but constantly get an error – i know im obviously doing something wrong, but with limited knnowledge dont know where to look now – then on top of that, grabbing a file name from that coll is something else that has me baffled.

i hope you got and understood my email. i need all the advice i can get!

regards
Robert.

#127712
Apr 24, 2008 at 5:41am

is this what you’re trying to do?

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 92 47 131 196617 store new filename;
#P newex 75 418 63 196617 jit.qt.movie;
#P newex 75 393 68 196617 prepend read;
#P number 205 302 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 75 369 69 196617 route symbol;
#N coll ;
#P newobj 75 343 94 196617 coll;
#P button 75 45 15 0;
#P newex 75 68 67 196617 t b date time;
#P newex 75 285 61 196617 pack i s;
#N counter;
#X flags 0 0;
#P newobj 75 251 124 196617 counter;
#P number 181 166 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 145 166 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 109 166 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 109 144 82 196617 unpack 0 0 0;
#P newex 155 214 250 196617 sprintf symout vid-%ld-%ld-%ld.%ld-%ld-%ld.mov;
#P number 296 165 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 260 165 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 224 165 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 224 143 82 196617 unpack 0 0 0;
#P newex 109 92 40 196617 date;
#B color 5;
#P window linecount 2;
#P comment 144 393 330 196617 this only works if the folder the files were saved in is in the file path. otherwise you must combine with the absolute folder path using sprintf;
#P window linecount 1;
#P comment 243 302 131 196617 retrieve file name at index;
#P connect 19 0 20 0;
#P connect 17 0 19 0;
#P connect 16 0 17 0;
#P fasten 18 0 16 0 210 330 80 330;
#P connect 14 2 2 0;
#P connect 14 1 2 0;
#P connect 15 0 14 0;
#P connect 14 0 12 0;
#P connect 7 0 13 1;
#P connect 12 0 13 0;
#P connect 13 0 16 0;
#P connect 2 0 8 0;
#P connect 8 0 9 0;
#P connect 8 1 10 0;
#P fasten 11 0 7 0 186 210 160 210;
#P connect 8 2 11 0;
#P fasten 9 0 7 1 114 201 208 201;
#P fasten 2 1 3 0 129 128 229 128;
#P connect 3 0 4 0;
#P fasten 10 0 7 2 150 201 256 201;
#P connect 3 1 5 0;
#P fasten 4 0 7 3 229 193 283 193;
#P connect 3 2 6 0;
#P fasten 5 0 7 4 265 193 324 193;
#P fasten 6 0 7 5 300 179 300 193 365 193;
#P window clipboard copycount 22;

#127713
Apr 24, 2008 at 10:48am

omg yes its getting there you are a champ

i wish I knew what all the areguments meant- im getting there.

do you mind if i keep asking questions? i will post my final working patch for people once its done, i dont mind! its been a great learning process !

ok, i integrated that into my current patch and works like a charm… im not sure what the number object inputting into the coll object is doing, nor do i know what the i and s after pack means, but ill get there. i also dont know what the symout after sprintf means either…
hmm

none the less i must hammer on. i have made the coll count only 4 lines of data to make this project simple. so its recording names of 4 videos which is good. i now need to read that each line, and play that video. im working on that now. i hope i get it going!
what can i use as a switch for more than 2 things. so if there are four outputs, and they all input into switch 1, i want that input to switch to switch two when there is a new input in switch 1…

lots of questions, im sorry if im hassling you!

#127714
Apr 25, 2008 at 7:31am

ok, so i have made leaps and bounds thanks to chris and rob.

i have more questions though!

i have figured out how to read index lines from what is populated in the coll object. that is fine – but i need to do this 16 individual times. this i kind of have figured out

the only problem now is routing each one back to its own movie player and not to all 16 players. i thought that i could accomplish this with the route object, but i have failed miserably. is there another way?? or is it possible with the route… i have attached a part of my patch to show you what i have done with some notes.

#127715
Apr 25, 2008 at 7:10pm

trigger and gate are your friends.
as are the max tutorials.

once you get the hang of this, you should check out the poly_for_movies patch in the jitter examples folder. much easier to manage multiple movies that way.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 324 224 41 196617 print 4;
#P newex 247 224 41 196617 print 3;
#P newex 169 225 41 196617 print 2;
#P newex 98 225 41 196617 print 1;
#P newex 63 85 27 196617 t i i;
#P newex 80 176 240 196617 gate 4;
#P newex 308 207 63 196617 jit.qt.movie;
#P newex 232 207 63 196617 jit.qt.movie;
#P newex 156 207 63 196617 jit.qt.movie;
#P newex 80 207 63 196617 jit.qt.movie;
#P number 63 59 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N coll ;
#T flags 1 0;
#T 1 movie1.mov;
#T 2 movie2.mov;
#T 3 movie2.mov;
#T 4 movie4mov;
#P newobj 310 142 110 196617 coll;
#P connect 6 3 5 0;
#P connect 6 3 11 0;
#P connect 6 2 4 0;
#P connect 6 2 10 0;
#P connect 6 0 2 0;
#P connect 6 0 8 0;
#P connect 6 1 3 0;
#P connect 6 1 9 0;
#P fasten 7 0 0 0 68 122 315 122;
#P connect 7 1 6 0;
#P connect 1 0 7 0;
#P connect 0 0 6 1;
#P window clipboard copycount 12;

#127716

You must be logged in to reply to this topic.