本文介绍如何使用 k4arecorder 命令行实用工具将传感器 SDK 中的数据流记录到文件。
注释
Azure Kinect 录制器不录制音频。
录制器选项
k4arecorder具有各种命令行参数来指定输出文件和录制模式。
录音以 Matroska .mkv 格式存储。 录制使用多个视频轨道来捕捉颜色和深度,还包括相机校准和元数据等附加信息。
k4arecorder [options] output.mkv
Options:
-h, --help Prints this help
--list List the currently connected K4A devices
--device Specify the device index to use (default: 0)
-l, --record-length Limit the recording to N seconds (default: infinite)
-c, --color-mode Set the color sensor mode (default: 1080p), Available options:
3072p, 2160p, 1536p, 1440p, 1080p, 720p, 720p_NV12, 720p_YUY2, OFF
-d, --depth-mode Set the depth sensor mode (default: NFOV_UNBINNED), Available options:
NFOV_2X2BINNED, NFOV_UNBINNED, WFOV_2X2BINNED, WFOV_UNBINNED, PASSIVE_IR, OFF
--depth-delay Set the time offset between color and depth frames in microseconds (default: 0)
A negative value means depth frames will arrive before color frames.
The delay must be less than 1 frame period.
-r, --rate Set the camera frame rate in Frames per Second
Default is the maximum rate supported by the camera modes.
Available options: 30, 15, 5
--imu Set the IMU recording mode (ON, OFF, default: ON)
--external-sync Set the external sync mode (Master, Subordinate, Standalone default: Standalone)
--sync-delay Set the external sync delay off the master camera in microseconds (default: 0)
This setting is only valid if the camera is in Subordinate mode.
-e, --exposure-control Set manual exposure value (-11 to 1) for the RGB camera (default: auto exposure)
记录文件
示例 1。 记录深度 NFOV 未绑定 (640x576) 模式,RGB 1080p,分辨率为 30 fps,带有 IMU。 按 Ctrl-C 键停止录制。
k4arecorder.exe output.mkv
示例 2。 在无 IMU 的情况下,记录宽视场 (WFOV) 非合并 (1MP) 的 RGB 3072p,帧率为 15 fps,持续 10 秒。
k4arecorder.exe -d WFOV_UNBINNED -c 3072p -r 15 -l 10 --imu OFF output.mkv
示例 3。 记录 WFOV 2x2 图像,30 fps 帧率,持续 5 秒,并保存为名为 output.mkv 的文件。
k4arecorder.exe -d WFOV_2X2BINNED -c OFF --imu OFF -l 5 output.mkv
小窍门
可以使用 Azure Kinect Viewer 在录制之前配置 RGB 相机控件(例如设置手动白平衡)。
验证录制
可以使用 Azure Kinect 查看器打开输出 .mkv 文件。
若要提取音轨或查看文件信息,可以使用作为 MKVToolNix 工具包一部分的 mkvinfo 工具。