Ask Your Question

Revision history [back]

If you want to store your data in a video format, then simply do it by pushing your resulting images into a VideoWriter stream. More info in the documentation!

A code snippet that illustrates the idea

// Create globally a VideoWriter element
// Adapt parameters to your needs
VideoWriter video_output ("~/video.avi", CV_FOURCC("M","J","P","G"), 25, Size(480, 640), true);

// Matrix containing the dept data
// Use your previous processing to push data into this
Mat depth_data;

// Push the image to the video stream
depth_data >> video_output;