ofxQtVideoSaver slow frame rate/dropping frames

I’m working on a desktop application which plays a 30fps video file and overlays some drawn graphics during the draw loop- overall the app runs between 45-60fps. I’m trying to combine this with ofxQtVideoSaver to export a hires video of whats happening on screen. When it’s ‘recording’ the framerate drops to around 7fps. Nothing unusual there, but I thought if i wait for the isFrameNew() on the video player before recording the frames to a movie i wouldn’t miss any frames? am i missing something? When i view the exported video it’s dropping loads of frames and quicktime is telling me the video framerate is 9fps.

I don’t care if it’s slow when exporting the video, i just want the exported video to be run at the same fps as the loaded video file. I don’t know if a threaded exporter will make that much of a difference, as i just need to cue the frames for export?

The addon: https://github.com/jamezilla/ofxQTVideoSaver


Are you trying to draw and export at the same time? I am wondering if this would give you a better framerate (like rendering to RAM)

  • preallocate a set of ofImages (say 300)
  • use these in update to capture your content
  • stop drawing (say on keypress)
  • loop through 300 images and pass them into ofxQtVideoSaver::addFrame
  • write out the file with ofxQtVideoSaver

ofVideoPlayer’s isFrameNew tells you if there is a new frame available, but it will also drop frames to keep the video at a real-time playback speed. So, if your app is only able to run at 7fps due to the video saver overhead, the player will be internally updating at the right speed, but by the time your app has gotten around to the update() function again, it will have skipped over frames. jcleave’s solution sounds good.

Great advice and suggestions- thanks! Will give this a try.