Hi,
I tried to import an video in my project and then exported this video using ofxVideoRecorder. However, the image quality is not satisfactory. And I cannot find a way to record audio from my video, the audio recorded was from outside.
The video image before & after:
Well, the problem with the image quality was solved. It was just that I did not set the video bitrate right.
But I still have the problem with audio recording from video.
void ofApp::audioIn(float *input, int bufferSize, int nChannels) {
if (bRecording) {
vidRecorder.addAudioSamples(input, bufferSize, nChannels);
}
}
2.you can merge your recorded movie with audio (.mp3 or .wav) file afterwards.
You can use the same ffmpeg application which ofxVideoRecorder uses for merging.
Here is some information how to merge audio and video:
Hi Sebastian,
I’m very appreciated for your reply.
But what I actually want to is to complete this whole procedure in oF.
Now I’m thinking about how to get audio from my video,
and then I can process this audio sample in audioOut(), like:
void ofApp::audioOut(float * output, int bufferSize, int nChannels) {
for (int i = 0; i < bufferSize; i++) {
double sample = video.getAudioSample();
output[i * nChannels + 0] = sample;
output[i * nChannels + 1] = sample;
}
if (bRecording) {
vidRecorder.addSamples(output, bufferSize * 2);
}
}
Hi, @SebastianSobotka
Sorry for late reply. I haven’t solved this yet and I’m busy with other things recently. But I will continue to work on it in the future. I’ll let you know if I get a clue.