Quantcast
Channel: openFrameworks - Latest posts
Viewing all articles
Browse latest Browse all 40524

How to get the current frame (pixel buffer) to record a video

$
0
0

Thank you hahakid! I solved it like so:

ofImage img;
img.grabScreen(0, 0, ofGetWidth(), ofGetHeight());
vidRecorder.addFrame(img.getPixels());

Now I have problems recording the audio. My code looks like this:

void ofApp::audioOut(ofSoundBuffer &buffer) {
  auto b = buffer.getBuffer();
  vidRecorder.addAudioSamples(&b[0], b.size(), buffer.getNumChannels());
}

Problem is that the audioOut(...) is not called. This is how I initialise my ofSoundPlayer:

player.load("gold.mp3");
player.setVolume(0.75f);
player.play();

I guess I have to connect the player to ofApp. Am I on the right track here?


Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>