MCAP Recording¶
This example showcases the use of SDK to save to MCAP file format. The MCAP file contains color as well as both left and right mono cameras and their inferred depth map.
Note
Visualization in current example is done with blocking behavor. This means that the program will halt at oak.start()
until the window is closed.
This is done to keep the example simple. For more advanced usage, see Blocking behavior section.
Setup¶
Please run the install script to download all required dependencies. Please note that this script must be ran from git context, so you have to download the depthai repository first and then run the script
git clone https://github.com/luxonis/depthai.git
cd depthai/
python3 install_requirements.py
For additional information, please follow our installation guide.
Source Code¶
Also available on GitHub.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | from depthai_sdk import OakCamera, RecordType with OakCamera() as oak: color = oak.create_camera('color', resolution='1080P', fps=30, encode='MJPEG') color.config_color_camera(isp_scale=(2, 3)) # 720P left = oak.create_camera('left', resolution='400p', fps=30) right = oak.create_camera('right', resolution='400p', fps=30) stereo = oak.create_stereo(left=left, right=right) # Sync & save all streams recorder = oak.record([color.out.encoded, left, right, stereo.out.depth], './', RecordType.MCAP) # recorder.config_mcap(pointcloud=True) oak.visualize(left) oak.start(blocking=True) |