Created
June 8, 2017 13:53
-
-
Save arturoc/9fa84d875ad1f52bcb0bea328230cf95 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listeners.push_back(m_bExportFrames.newListener([this](bool & record){ | |
if(record){ | |
auto path = ofSystemLoadDialog("Record to images:", true); | |
if(path.bSuccess){ | |
auto folderPath = path.getPath(); | |
ofxTextureRecorder::Settings settings(fbo.getTexture()); | |
settings.imageFormat = OF_IMAGE_FORMAT_JPEG; | |
settings.folderPath = folderPath; | |
recorder.setup(settings); | |
}else{ | |
m_bExportFrames = false; | |
} | |
}else{ | |
recorder.stop(); | |
} | |
})); | |
listeners.push_back(m_bRecordVideo.newListener([this](bool & record){ | |
if(record){ | |
auto path = ofSystemSaveDialog("video.mp4", "Record to video:"); | |
if(path.bSuccess){ | |
auto videoRecorderPath = path.getPath(); | |
ofxTextureRecorder::VideoSettings recorderSettings(fbo.getTexture(), appfps); | |
recorderSettings.videoPath = videoRecorderPath; | |
auto ext = std::filesystem::path(videoRecorderPath).extension().string(); | |
if(ext==".mov"){ | |
recorderSettings.videoCodec = "prores"; | |
recorderSettings.extrasettings = "-profile:v 0"; | |
}else if(ext == ".hpv"){ | |
recorderSettings.videoCodec = "cocgy"; | |
}else{ | |
recorderSettings.videoCodec = "libx264"; | |
recorderSettings.extrasettings = "-preset ultrafast -crf 0"; | |
} | |
recorder.setup(recorderSettings); | |
}else{ | |
m_bRecordVideo = false; | |
} | |
}else{ | |
recorder.stop(); | |
} | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment