[visionegg] Re: slight lag in quicktime StartMovie on WXP

Hi Andrew,

Many thanks for your suggestions. Over the next week I will be trying them out, and will keep the listserv posted.

Best wishes,

John

Andrew Straw wrote:
Dear John,

I don't know if there are any QuickTime functions that would help with what you want, but given the behavior you describe, the following might help:

Render the movie once (or at least the first few frames) without drawing it to the screen. Then issue a movie.GoToBeginningOfMovie() command and start your main loop that does display the movie there. To render without drawing to the screen, you have 2 options immediately apparent: 1) draw frames as in the demo quicktime.py, but simply skip the swap_buffers() command. 2) Call the MovieTexture instance's update() method yourself while the MovieTexture isn't being rendered to the screen.

Option 1 is conceptually simpler, but it less elegant, as it does more work (actually completely drawing the movie to the back-buffer, just never flipping to that back buffer). Option 2 is a little trickier, because it requires you to set up some of the infrastructure necessary to call the MovieTexture's update method(). But I think both methods should work. And both, I think, should also work to pre-load one movie while another is playing. For option 2, this is probably readily obvious, but for option 1, after drawing the un-displayed movie to the back buffer, issue a screen.clear() command, draw your "real" scene, and then finally issue a swap_buffers() call.

(FWIW: I'm afraid that, despite writing the VE's QuickTime stuff (and one or two other things in QuickTime), I know relatively little regarding the QuickTime API. I generally find Apple's documentation and terminology so Apple-centric (and often ObjC centric) that there's a significant effort involved just finding and comprehending what they have written. In this case, QuickTime has extensive documentation, but I have yet to really understand even the fundamentals: http://developer.apple.com/reference/QuickTime/index.html . I do recall being an option when saving quicktime movies (With QuickTime Pro?) for "quick pre-loading" or something. Perhaps that's relevant.)

Anyhow, good luck, and I'd be happy to hear any reports.

Cheers!
Andrew

John Herrington wrote:
I'm using the bleeding edge version of visionegg (1.1.dev) to show quicktime movies as part of an eyetracking experiment. I'm running 1.1.dev on a Windows XP machine with an nvidia GPU. I've got a program up and running that works very well, with one caveat - there is a brief lag (perhaps 500 msec) in the experiment upon executing the StartMovie command. Upon rewinding and replaying the movie, there is no lag. The size of the lag appears to scale with the size of the quicktime file. I've observed this across a few PCs, all fairly modern/fast with nvidia GPUs. My hypothesis is that the lag is due to some loading or processing that happens as part of the StartMovie command.

My main question: is there some way to eliminate this lag? My thinking was that perhaps there is some way to take care of whatever preloading is related to the lag before actually displaying the movie. I took a look at qtlowlevel.py and it appears that this function wraps around QTMLClient.dll. I scoured the net for good documentation on this .dll, but could find very little there to guide me. It appears that the visionegg quicktime python files capitalize on a few specific functions that are part of QTMLClient.dll (such as StartMovie and GoToBeginningOfMovie). Are there other QTMLClient functions that might help in some sort of preloading?

I realize that the visionegg quicktime functions are bleeding edge... but if anyone can think of a solution to the lag issue (or for that matter, point me to whatever QTMLClient docs. were referenced when creating the qtlowlevel.py functions), that would be excellent. I'd be happy to send my experiment and corresponding video files if that would help diagnose the problem.

Thanks!

John Herrington, Ph.D.
Yale University

======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html


======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

Other related posts: