Videos recording using ofxPS3EyeGrabber

Hi. I would like to create a GUI button to record videos from 2 PS3 cameras using “example_advanced_multicam” 's ofxPS3EyeGrabber addon. How could I synchronize between “App fps” and “Cam fps” ? (fps = frame per second).
Thanks in advance.

duplicate here https://github.com/bakercp/ofxPS3EyeGrabber/issues/22

hey @PhuDoTuong,
to record the camera to a video file, you can use some addon to capture.
(https://ofxaddons.com/ https://addons.braitsch.io/)

Then usually you draw the camera (like any other drawing) into an ofFbo, that is being used to record into frame stills or encoded into an hard drive video file.

(Personally I am using this https://github.com/moebiussurfing/ofxSurfingCapturer
But there is many:)



1 Like

Hi @bakercp, sorry for my late response and unclear question. I illustrated my question on Videos recording · Issue #22 · bakercp/ofxPS3EyeGrabber (github.com).

Thank you for your guide and sharing your project. I will try to implement both ofxSurfingCapturer and ofxPS3EyeGrabber because PS3 is unnormal webcam.

ok. I see
if your app runs at 60 fps…
you can use a recorder that stores each frame as a tiff file.
but on every pair frame (if (ofGetFrameNum() % 2 == 0))
then, when encoding your video you can define which fps is from the source (webcam = 30)

theres a fast addon to do this https://github.com/arturoc/ofxTextureRecorder
(my above capturer addon uses this inside)

when using ffmpeg you can set the output framerate too.

1 Like

So, like with any ofVideoPlayer / ofVideoGrabber interface, new, “fresh” ofPixel objects are only available after you check grabber.isFrameNew(). So, I’m not sure how you are recording a video, but you would typically only add a frame to your video when the frame is new (e.g.

if (grabber.isFrameNew())
{
    recorder.addFrame(grabber.getPixels());

    // ...
}

This will ensure that you don’t duplicate frames in your recorded video.

This only applies to videos that are running less than the screen refresh rate. If your camera has a higher framerate than the screen refresh rate (e.g. > 60 Hz), then you will need to get all frames that are new since you last checked.

e.g.

if (grabber.isFrameNew())
{

            auto frames = grabber.getGrabber<ofxPS3EyeGrabber>()->getAllFrames();
        
            for (auto& frame: frames)
            {
                  recorder.addFrame(frame);
            }
       
{

To clarify the “cam fps” is the fps you requested from the camera. The “real fps” is the actual fps calculated with each new frame. The app fps is the result of ofGetFrameRate().

The slow-mo example shows how to deal with camera frame rates greater than your screen refresh rate

2 Likes

Thanks so much.