Crash setting up ofxQtVideoSaver after closing ofVideoPlayer


I’m building a simple application that lets me record one second duration videos, save them into,… files, and start playing them just after being recorded. I followed the information contained in this thread:

So I finally managed to make it work adding the SetGWorld instruction proposed by jroge, and deleting the DisposeMovie line in function finishMovie(), modification proposed by Zach (thanks _a lot_ for all the information provided in this thread!!)

My problem now comes when I try to erase all the videoplayers (stopping them and releasing their memory) and start capturing and playing new files _without_ closing the oF application.

I’ve tried several ways, but I always get a segfault the first time I call the setup() funtion in ofxQtVideoSaver _after having released all ofVideoPlayers_:
QuickTime!_CallComponentFunctionWithStorage () (C:\Archivos de programa\QuickTime\QTSystem\QuickTime.qts)
that is called from CreateMovieFile (ofxQtVideoSaver.cpp, line 79).

I guess it’s related with the closeMovie() function in ofVideoPlayer, which is called in the destructor of this class, but as I have no idea of how Quicktime works, i’m completely lost. Also, there’s no OF_ERROR or other output that explains this crash.

I’m in Windows XP / CodeBlocks, using the latest version of Quicktime (7.6.6).

I attach the source files if it can help. In this example, the app starts recording 1sec videos automatically when the applications is launched, and you can delete all videoPlayers (and make it crash) if you click any mouse button.

I could share the CB project if needed.

Any hint would be very much appreciated.


I found a workaround a bit dirty but it works for me :smiley: Calling closeQuicktime() between deleting the videoplayers and creating a new saver apparently fixes the crash.

However, if there are other grabbers or savers and we want to keep them grabbing/playing, this solution doesn’t work… Am I forgetting any function that should be called in order to release files or assets in Quicktime?

PS: I attach an example using only ofVideoPlayer to isolate the problem. The example is the same as the one provided with oF (moviePlayerExample) but using a pointer to ofVideoPlayer instead of a static variable. When you press the space bar, it deletes the pointer, creates a new one, calls loadMovie again…and crash.