← Back

ofxFfmpegRecorder2

github.com/kylemcdonald/ofxFfmpegRecorder2 · @kylemcdonald
OF 0.12 Video/Camera

Non-realtime FFmpeg video recorder for offline rendering that accepts every frame immediately without time-based throttling.

2 0 Last commit 9mo ago Created 9mo ago

README

ofxFfmpegRecorder2



Overview



Non-realtime video recorder using FFmpeg.

This addon is designed for offline/non-realtime rendering where frames are generated faster than realtime. Unlike ofxFFmpegRecorder, this class accepts every frame immediately without time-based throttling.

Key Differences from ofxFFmpegRecorder



1. NO TIME-BASED THROTTLING

2. SIMPLIFIED API

3. BOUNDED QUEUE

4. EXPLICIT START/STOP

Usage Example



ofPixels pixels;
pixels.allocate(1920, 1080, OF_PIXELS_RGBA);

FfmpegRecorder recorder;
recorder.setup(glm::vec2(1920, 1080), 30.0f, 8000, "/opt/homebrew/bin/ffmpeg");
recorder.setOutputPath("output.mp4");
recorder.setOverWrite(true);
recorder.start();

for (int i = 0; i < 300; i++) {
    // Render frame as fast as possible
    fbo.begin();
    // ... draw content ...
    fbo.end();
    fbo.readToPixels(pixels);
    recorder.addFrame(pixels);  // Pixel format auto-detected from ofPixels type
}

recorder.stop();  // Finalizes the video


Pixel Format Auto-Detection



The input pixel format is automatically detected based on the channel count: The format is detected on the first addFrame() call. You can still manually override it by calling setInputPixelFormat() before start() if needed.

API Reference



Setup & Control



Setters



Getters



Requirements



Get this addon

HTTPS
SSH