Forums > MaxMSP

buffer~: importing multiple channels from qt movie

July 12, 2007 | 9:14 am

Hi all,

I was wondering: if a quicktime movie contains multiple sound tracks, is there a way to import sound tracks other that the first one into a buffer~?

As far as I can see the import message only imports sound track 1.

Thanks,
Mattijs


July 13, 2007 | 9:19 am

Allright, ….

As far as I can see the most efficient way to import a quicktime movie with multiple sound tracks or with sound tracks with a start time offset into a buffer~, is like this:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 137 108 56 196617 r toBuffer;
#P newex 27 108 108 196617 buffer~ sample 100 2;
#B color 12;
#P newex 27 63 56 196617 opendialog;
#P button 27 44 15 0;
#N vpatcher 109 244 510 783;
#P origin 0 12;
#P window setfont "Sans Serif" 9.;
#P newex 277 122 56 196617 s toBuffer;
#P newex 104 247 174 196617 sprintf set track %i 0 %i track -1 0;
#P newex 62 247 40 196617 append;
#P newex 62 207 27 196617 t b i;
#P newex 62 227 36 196617 zl reg;
#P newex 64 126 69 196617 t 256 zlclear;
#P newex 17 145 25 196617 iter;
#P newex 17 62 27 196617 t b l;
#P newex 178 414 44 196617 zl nth 2;
#P newex 34 186 53 196617 t b b i b;
#P message 48 288 75 196617 gettrackoffset;
#P newex 17 165 27 196617 t b i;
#P message 34 306 79 196617 trackoffset 1 0;
#P newex 34 82 27 196617 t l b;
#P newex 277 102 66 196617 prepend size;
#N vpatcher 180 672 441 926;
#P window setfont "Sans Serif" 9.;
#P newex 119 111 44 196617 zl nth 2;
#P newex 102 171 27 196617 i;
#P newex 119 151 18 196617 t i;
#P newex 119 131 62 196617 maximum 0;
#P newex 24 50 40 196617 t b l 0;
#P newex 119 91 98 196617 route trackduration;
#P newex 39 91 63 196617 jit.qt.movie;
#P newex 39 71 123 196617 prepend gettrackduration;
#N comlet path;
#P inlet 24 30 15 0;
#N comlet duration;
#P outlet 102 193 15 0;
#P connect 1 0 5 0;
#P connect 5 1 2 0;
#P connect 2 0 3 0;
#P connect 5 0 8 0;
#P connect 8 0 0 0;
#P connect 3 1 4 0;
#P connect 4 0 9 0;
#P connect 9 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 8 1;
#P connect 7 0 6 1;
#P connect 5 2 6 1;
#P pop;
#P newobj 268 83 97 196617 p getMovieDuration;
#B color 5;
#P newex 17 42 40 196617 t l l l;
#P newex 109 414 44 196617 zl nth 1;
#P newex 109 433 72 196617 append 0 -1 2;
#P newex 109 452 75 196617 prepend import;
#P newex 109 471 99 196617 buffer~ temp 100 2;
#P newex 17 344 106 196617 prepend savemovieas;
#N vpatcher 20 74 213 281;
#P window setfont "Sans Serif" 9.;
#N vpatcher 222 511 569 832;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 134 117 67 196617 unpack 0 0 0;
#P newex 63 148 27 196617 t b i;
#P newex 37 51 30 196617 t b b;
#P window linecount 1;
#P newex 37 237 36 196617 zl reg;
#P newex 63 216 194 196617 sprintf %i%02d%02d-%i%02d%02d-%i;
#P newex 63 116 67 196617 unpack 0 0 0;
#P newex 63 73 84 196617 t date time ticks;
#P newex 63 94 40 196617 date;
#N comlet (bang) get date;
#P inlet 37 33 15 0;
#N comlet date string;
#P outlet 37 257 15 0;
#P connect 1 0 7 0;
#P connect 7 0 6 0;
#P connect 6 0 0 0;
#P connect 7 1 3 0;
#P connect 3 2 2 0;
#P connect 3 1 2 0;
#P connect 3 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 8 0;
#P connect 4 2 5 0;
#P connect 8 0 5 0;
#P connect 5 0 6 1;
#P connect 4 1 5 1;
#P connect 8 1 5 2;
#P connect 2 1 9 0;
#P connect 9 0 5 3;
#P connect 9 1 5 4;
#P connect 9 2 5 5;
#P connect 2 2 5 6;
#P pop;
#P newobj 35 47 78 196617 p getdatestring;
#B color 5;
#P newex 35 123 51 196617 tosymbol;
#P newex 35 104 89 196617 sprintf ./%s.mov;
#P newex 35 66 70 196617 prepend temp;
#P newex 35 85 51 196617 tosymbol;
#N comlet bang;
#P inlet 35 30 15 0;
#N comlet name;
#P outlet 35 142 15 0;
#P connect 1 0 6 0;
#P connect 6 0 3 0;
#P connect 3 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 0 0;
#P pop;
#P newobj 17 324 81 196617 p genTempName;
#B color 5;
#P newex 17 126 46 196617 zl group;
#P newex 109 395 149 196617 route savemovieas trackoffset;
#P message 90 207 124 196617 newmovie 360 288 1000;
#N vpatcher 818 167 1112 564;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 60 291 27 196617 + 0;
#P newex 144 117 27 196617 f;
#P newex 20 117 27 196617 f;
#P window linecount 0;
#P newex 20 51 40 196617 t b b b;
#P window linecount 1;
#P newex 50 93 46 196617 / 1000.;
#P newex 144 138 41 196617 * 44.1;
#N comlet (int , ms) offset;
#P inlet 161 33 15 0;
#P newex 20 138 41 196617 * 44.1;
#P window linecount 0;
#P newex 60 226 40 196617 t i i i;
#P newex 60 331 70 196617 peek~ sample;
#P newex 75 266 27 196617 + 0.;
#P newex 140 246 70 196617 peek~ sample;
#P newex 20 159 27 196617 t b i;
#P newex 20 206 50 196617 uzi 1000;
#P newex 20 179 40 196617 uzi 2;
#P newex 50 73 105 196617 info~ temp;
#P newex 75 246 61 196617 peek~ temp;
#N comlet bang;
#P inlet 20 33 15 0;
#P newex 60 311 38 196617 zl join;
#P connect 1 0 15 0;
#P connect 15 0 16 0;
#P connect 16 0 11 0;
#P connect 11 0 6 0;
#P connect 6 0 4 0;
#P connect 4 0 5 0;
#P connect 3 6 16 1;
#P connect 15 2 3 0;
#P connect 3 0 14 0;
#P connect 14 0 11 1;
#P connect 6 1 5 1;
#P connect 5 2 10 0;
#P connect 10 0 18 0;
#P connect 18 0 0 0;
#P connect 0 0 9 0;
#P connect 10 1 2 0;
#P connect 2 0 8 0;
#P connect 13 0 18 1;
#P connect 8 0 0 1;
#P connect 7 0 8 1;
#P fasten 4 2 9 2 55 201 125 201;
#P fasten 4 2 2 2 55 201 130 201;
#P connect 10 2 7 0;
#P connect 15 1 17 0;
#P connect 17 0 13 0;
#P connect 12 0 17 1;
#P connect 14 0 13 1;
#P fasten 4 2 7 2 55 201 205 201;
#P pop;
#P newobj 198 491 100 196617 p addTempToSample;
#B color 5;
#P newex 62 267 75 196617 prepend insert;
#P newex 17 375 102 196617 jit.qt.movie @rate 0;
#N vpatcher 129 639 438 950;
#P window setfont "Sans Serif" 9.;
#P newex 80 130 29 196617 t l 0;
#P newex 116 195 32 196617 sel 1;
#P newex 188 195 32 196617 sel 1;
#P newex 188 215 21 196617 t 2;
#P newex 116 215 21 196617 t 1;
#P newex 188 175 70 196617 strcmp sound;
#P newex 116 175 69 196617 strcmp video;
#P newex 99 239 47 196617 gate 2 1;
#P newex 27 70 49 196617 append 0;
#P newex 27 50 103 196617 prepend gettrackinfo;
#P newex 80 150 83 196617 unpack 0 s s 0 0;
#P newex 80 110 78 196617 route trackinfo;
#P newex 27 90 63 196617 jit.qt.movie;
#N comlet bang;
#P inlet 27 30 15 0;
#N comlet video track nr;
#P outlet 99 261 15 0;
#N comlet audio track nr;
#P outlet 136 261 15 0;
#P connect 2 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 3 0;
#P connect 3 1 4 0;
#P connect 4 0 15 0;
#P connect 15 0 5 0;
#P connect 11 0 8 0;
#P connect 12 0 8 0;
#P connect 15 1 8 0;
#P connect 8 0 1 0;
#P connect 5 2 9 0;
#P connect 9 0 14 0;
#P connect 14 0 11 0;
#P connect 5 0 8 1;
#P connect 8 1 0 0;
#P connect 5 2 10 0;
#P connect 10 0 13 0;
#P connect 13 0 12 0;
#P pop;
#P newobj 34 102 101 196617 p getMovieTrackNrs;
#B color 5;
#N comlet path;
#P inlet 17 25 15 0;
#P connect 0 0 14 0;
#P connect 14 0 23 0;
#P connect 25 1 7 0;
#P connect 23 0 7 0;
#P connect 1 1 7 0;
#P connect 7 0 24 0;
#P connect 24 0 19 0;
#P connect 19 0 8 0;
#P connect 8 0 9 0;
#P fasten 3 0 2 0 67 369 22 369;
#P fasten 18 0 2 0 39 369 22 369;
#P connect 9 0 2 0;
#P fasten 5 0 2 0 95 369 22 369;
#P fasten 20 0 2 0 53 369 22 369;
#P connect 23 1 17 0;
#P connect 17 0 1 0;
#P connect 19 1 21 0;
#P connect 21 0 18 0;
#P connect 21 1 20 0;
#P connect 25 0 7 1;
#P connect 21 2 27 0;
#P connect 27 0 26 0;
#P connect 26 0 28 0;
#P connect 29 0 28 0;
#P connect 28 0 3 0;
#P connect 17 1 25 0;
#P connect 14 1 26 1;
#P connect 21 3 5 0;
#P connect 27 1 29 0;
#P connect 2 1 6 0;
#P connect 6 0 13 0;
#P connect 13 0 12 0;
#P connect 12 0 11 0;
#P connect 11 0 10 0;
#P connect 6 1 22 0;
#P connect 10 1 4 0;
#P connect 14 2 15 0;
#P connect 15 0 29 1;
#P connect 15 0 16 0;
#P connect 16 0 30 0;
#P connect 22 0 4 1;
#P pop 1;
#P newobj 27 84 85 196617 p movieToBuffer;
#B color 5;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P connect 4 0 3 0;
#P window clipboard copycount 5;

Pretty crazy though…

Mattijs


July 20, 2007 | 10:30 am

Dear Cycling, is there any chance that this will change in the near future? Loading times are at an all-time high here…

Mattijs


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