Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use ofVideoPlayer after saving a video #4

Open
dncabral opened this issue Jul 10, 2013 · 2 comments
Open

Cannot use ofVideoPlayer after saving a video #4

dncabral opened this issue Jul 10, 2013 · 2 comments

Comments

@dncabral
Copy link

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.

@jamezilla
Copy link
Owner

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.

@dncabral
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants