Function description: Connect the device to start streaming, record the current video stream to a file, and exit the program with the ESC_KEY key
| This example is based on the C++High Level API for demonstration
Firstly, it is necessary to create a pipeline, through which multiple types of streams can be easily opened and closed, and a set of frame data can be obtained
ob::Pipeline pipe;
Get the stream configuration of the depth camera
depthProfile = std::const_pointer_cast<ob::StreamProfile>(profiles->getProfile(OB_PROFILE_DEFAULT))->as<ob::VideoStreamProfile>();
Configure which streams to enable or disable in the Pipeline by creating a Configuration, where depth streams will be enabled
// Configure the stream types opened by Pipeline
std::shared_ptr<ob::Config> config = std::make_shared<ob::Config>();
config->enableStream(depthProfile);
Start the stream configured in Configuration. If no parameters are passed, the default configuration start stream will be activated, and the recording switch will be activated
pipe.start(config);
pipe.startRecord("./OrbbecPipeline.bag");
Wait for a frame of data in a blocking manner, which is a composite frame containing frame data for all streams enabled in the configuration, and set the waiting timeout time for the frame
auto frameSet = pipe.waitForFrames(100); // Set the waiting time to 100ms
Stop Pipeline, no more frame data will be generated
pipe.stop();