ofxQTVideoSaver
ofxQTVideoSaver copied to clipboard
Cannot use ofVideoPlayer after saving a video
Hi Jame,
After I save a video using the ofxQTVideoSaver addon, I try to open it using ofVideoPlayer. However, calling loadMovie("recordedvideo.mov") after the finishMovie() function, the application crashes. Any reason for the crash? Any tip to solve it? I'm using VS2010, Windows 7 and ofv7.3.
Apologies for the slow response, I'm out of town.
I'm not exactly sure what's going on here, but I suspect it's a threading issue. finishMovie() is probably asynchronous - especially since it's syncing an encoding buffer to disk.
Try throwing a sleep statement in there (eg. ofSleep()) between finish and load. Give it maybe 5 seconds to finish up. See if that fixes it.
If you need quick record/playback, I'd suggest just buffering frames in memory. I do this kind of thing all the time. I could send you some sample code on Monday or Tuesday. If you need durable clips, then setting up a second buffer for background encoding is the way I'd do it.
- James
On Jul 10, 2013, at 10:02 AM, dncabral [email protected] wrote:
Hi Jame,
After I save a video using the ofxQTVideoSaver addon, I try to open it using ofVideoPlayer. However, calling loadMovie("recordedvideo.mov") after the finishMovie() function, the application crashes. Any reason for the crash? Any tip to solve it? I'm using VS2010, Windows 7 and ofv7.3.
— Reply to this email directly or view it on GitHub.
Hi James,
No prob. Thanks for your reply.
The solution ofSleep() did not work too. My hint is that it is about closing the QuickTime on finishMovie() but it is just a hint.
I also tried the opencv videowriter (since i'm using opencv in my application) but the frames colors were strange (almost blue, perhaps some issue about the image format and the codecs)
My solution passed by not using the ofVideoPlayer class but updating the images as in the ofxImageSequencePlayback addon. I did not really use the addon because I already had the frames in memory. I just adapted my update and draw functions.
I hope my post can help other programmers with same problem.