Re: Synchronizing QTMovieLayers
Re: Synchronizing QTMovieLayers
- Subject: Re: Synchronizing QTMovieLayers
- From: Seth Willits <email@hidden>
- Date: Tue, 6 Jan 2009 11:29:30 -0800
Thank you very much, Matt. I'll look at this today. The movies aren't
too large and are only being played on a top end Mac Pro, so the
performance so far is fine. Though I did think about the potential of
having to do something myself in GL. Your post will help, if I do.
Thanks again,
(I'm glad the mailing lists are working again!)
--
Seth Willits
On Jan 6, 2009, at 7:56 AM, Matt Long wrote:
Seth,
Synchronization is done at a lower level. You need to get the movie
time base of the movie you want to be the master and then set the
master time base for the movie you want to be the slave. Since this
is done at the Movie primitive level it doesn't matter that you are
using QTMovieLayers. This is the basic code you need:
QTMovie *master... // initialized somewhere
QTMovie *slave... // Initialized somewhere
TimeBase mtb = GetMovieTimeBase([master quickTimeMovie]);
SetTimeBaseMasterTimeBase(mtb, GetMovieTimeBase([slave
quickTimeMovie]), nil);
Then call play on both movies:
[master play];
[slave play];
The docs for both of those time base calls are here: http://developer.apple.com/documentation/QuickTime/Reference/QTRef_MovieManager/Reference/reference.html
As a side note, you are going to have some performance issues
playing back two movies. You will likely need to go to using OpenGL
to squeeze out every bit of performance. I wrote a blog post on how
to composite a movie in a CAOpenGLLayer here: http://www.cimgf.com/2008/09/10/core-animation-tutorial-rendering-quicktime-movies-in-a-caopengllayer/
. You can use this technique to composite multiple video channels
at once.
HTH,
-Matt
On Jan 2, 2009, at 3:13 PM, Seth Willits wrote:
Howdy guys,
I have a need to make sure multiple QTMovieLayers are in perfect
sync. In other words, I need them to start at exactly the same
time. If you just do a few [movieN play] in a row, they're slightly
off from each other.
Has anyone done this? Any suggestions? (I'd really rather not have
to pull frames out of the movie and manually draw them myself or
something like that.)
--
Seth Willits
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden