ofxVideoRecorder icon indicating copy to clipboard operation
ofxVideoRecorder copied to clipboard

Allow auto-syncing to be disabled for non-realtime streams

Open microcosm opened this issue 9 years ago • 3 comments

microcosm avatar Aug 19 '16 18:08 microcosm

There is already an option to disable syncing to the system clock for video only streams. Is it your intention to allow recording video+audio without automatic synchronization?

timscaffidi avatar Aug 22 '16 02:08 timscaffidi

Yes, exactly. I'm using synths to generate sound and drawing to an ofFbo to generate video frames. When everything runs at 60fps, it's fine and I don't need this feature. But sometimes I want to manipulate CPU-intensive graphics. I want to send exactly the right number of frames and the right amount of audio, and have it all render nicely to a video file.

This example shows where I'm at with it. The example code there works perfectly and lets you run at 30fps. I put real-time commands into a queue (see logCommand) so that the graphics and sound all sync up.

Everything works perfectly in that example, although I'm having trouble when I start working with heavy graphics, something is breaking the A/V sync when I do that.

microcosm avatar Aug 22 '16 13:08 microcosm

I see where you're coming from. However there is already bSysClockSync to control the synchronization, and while it does not accomplish what you want currently, I do not want to add another feature with such a similar sounding method name. I think it would be confusing as to which property controls what.

It might be better to just have one option for synchronization, but just change the behavior to support your use case. Essentially, if ((bRecordAudio || bSysClockSync) && !bFinishing) { would become if (bSysClockSync && !bFinishing) {

I think just this change would support your use case, and if bSysClockSync were defaulted to true, there would be minimal impact to the majority of users.

timscaffidi avatar Sep 07 '16 02:09 timscaffidi