Forums > MaxMSP

how to sync audio to movie (and vice versa)


f.e
February 26, 2008 | 10:46 am

Hello,

I’ve searched the archives about playing audio of a movie file. I don’t
do that often but each time it seems like a pain to do it.

As i’m using QT7, i guess i have to forget spigot~.

Then, archives suggest to use the third outlet of an sfplay~. But is it
reliable ? ( a post from 2005 says it is not)

Moreover, my movie has to be perfectly synchronized (to make it brief,
each instrument of the rythmn track "triggers" a visual stuff), so i’m
affraid to use the ms to frame conversion to drive my jit.qt.movie…

I know a lot of people here do this all day long, maybe you could tell
me how to do it the best way ?

Also, i wonder why there’s no example patch for something so simple as
playing a movie in sync with its audio track in an audio/video software
like max…

I know this is a very very basic question and i’m sorry i didn’t find
any help in the archives.

best

f.e


f.e chanfrault | aka | personal computer music
>>>>>>> http://www.personal-computer-music.com
>>>>>>> |sublime music for a desperate people|



f.e
February 26, 2008 | 11:25 am


February 27, 2008 | 5:27 pm

f.e schrieb:
> Is it supposed to be reliable ? :
>
> ……
> #P newex 213 339 44 9109513 metro 2;
> …..

nice example, but I’d like to know why (I’ve seen it a lot) you set a
metro with 2 miliseconds? Doesn’t it create completely useless messages
for nothing? wouldn’t a snapshot 33 (according to a max of 30 fps
output) and a bang from the same snapshot create less scheduler events?

something like this:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 293 289 13 196617 b;
#P newex 376 165 34 196617 * 33;
#P comment 359 233 152 196617 current movie has 10fps…;
#P newex 507 274 45 196617 loadbang;
#P message 507 301 133 196617 trackvol 1 0 , trackvol 2 0;
#P user ezdac~ 260 232 304 265 0;
#P message 260 305 26 196617 read;
#P toggle 292 117 15 0;
#P message 260 117 28 196617 open;
#P user jit.pwindow 307 381 322 242 0 1 0 0 1 0;
#P newex 308 289 83 196617 prepend frame;
#P newex 308 253 78 196617 snapshot~;
#P newex 308 215 48 196617 /~ 100;
#P newex 308 343 110 196617 jit.qt.movie 320 240;
#N sfplay~ 2 60000 1 ;
#P newobj 260 165 103 196617 sfplay~ 2 60000 1;
#P comment 359 217 100 196617 1000 ms / fps;
#P fasten 8 0 1 0 297 153 265 153;
#P fasten 8 0 14 0 297 153 381 153;
#P connect 14 0 4 1;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 4 0 15 0;
#P connect 15 0 2 0;
#P connect 12 0 11 0;
#P connect 2 0 6 0;
#P fasten 11 0 2 0 512 330 313 330;
#P fasten 9 0 2 0 265 332 313 332;
#P connect 5 0 2 0;
#P connect 1 2 3 0;
#P connect 1 1 10 1;
#P connect 7 0 1 0;
#P connect 1 0 10 0;
#P window clipboard copycount 16;


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com



f.e
February 28, 2008 | 10:21 am


February 28, 2008 | 10:32 am

On Wed, Feb 27, 2008 at 9:27 AM, Stefan Tiedje wrote:
> f.e schrieb:
>
> > Is it supposed to be reliable ? :
> >
> > ……
>
> > #P newex 213 339 44 9109513 metro 2;
> > …..
>
> nice example, but I’d like to know why (I’ve seen it a lot) you set a
> metro with 2 miliseconds?

It’s an unfortunate artifact of people copying some of the
help/example patches without modification. That’s why you see it so
much.

wes


February 28, 2008 | 3:40 pm


February 29, 2008 | 9:41 pm

yeah, i would think a local, hard-wired network would have no problem sending out 25 frame sync messages per second, without any noticeable issues.
if so, perhaps slightly delay the "sync-er" to better match the "sync-ees".



f.e
March 3, 2008 | 2:33 pm


March 3, 2008 | 10:55 pm

i got frame accurate results using same resolution, 25fps photojpeg
files over 4 macmini G4 computers. I was actually using one computer
as master counter (qmetro 40 -> counter) and sending 4 different frame
messages over udp.

recently i tried only triggering (start-stop) 4 movies (because i
needed sound), but i couldn’t get them to start at the same time. they
were always up to 1 second late. i didn’t have enough time to test it,
but the patch as very simple. the only difference was that master
computer was also playing one of the movie files – i suspect that the
problem was that i started start movie file and tried to send start
messages after that – maybe computer was too busy starting quicktime
file to be frame accurate. i plan to try the same patch with different
message order. i wonder if i’ll get better results.


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