This message was posted on behalf of Intel Corporation
We hope the following suggestions help you.
- Offload the save routine to a dedicated thread (using librealsense queus to pass frames around). You may also `frame.keep` API to keep . This should be sufficient to save sequences of (at least) tens of frames
- PNG has an built-in compression mechanism. According to `stbi` documentation it is enabled by default: PNG allows you to set the deflate compression level by setting the global variable 'stbi_write_png_compression_level' (it defaults to 8).”
Intel Customer Support
Can you try OpenCV? More specifically, using the following:
cv::Mat rgbMat(height, width, CV_8UC3); // Create OpenCV inputArray for saving, CV_8UC3 for color and depth images, CV_8UC1 for INFRARED images
memcpy(rgbMat.data, frame.get_data(), sizeof(unsigned char) * IMAGE_SIZE); // copy from frame, IMAGE_SIZE is the WIDTH * HEIGHT * bytes_per_pixel
cv::imwrite(filename, rgbMat); // save to disk
You can do this either in a dedicated thread or the same thread as the fetching of frames. The latter case will give you around 10Hz frequency.