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
ob::Pipeline pipe;
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);
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
pipe.stop();