• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Synchronizing QTMovieLayers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Synchronizing QTMovieLayers


  • Subject: Re: Synchronizing QTMovieLayers
  • From: Matt Long <email@hidden>
  • Date: Tue, 6 Jan 2009 08:56:26 -0700

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


  • Follow-Ups:
    • Re: Synchronizing QTMovieLayers
      • From: Seth Willits <email@hidden>
References: 
 >Synchronizing QTMovieLayers (From: Seth Willits <email@hidden>)

  • Prev by Date: Re: QTMovieLayer and QCCompositionLayer Don't Start
  • Next by Date: RE: Binary search on sorted NSArray in Cocoa?
  • Previous by thread: Re: Synchronizing QTMovieLayers
  • Next by thread: Re: Synchronizing QTMovieLayers
  • Index(es):
    • Date
    • Thread