# 录制视频节点

RecordVideo 主机节点用于将 [ImgFrames](https://docs.luxonis.com/software-v3/depthai/depthai-components/messages/img_frame.md) 和
[EncodedFrames](https://docs.luxonis.com/software-v3/depthai/depthai-components/messages/encodedframe.md) 录制为视频和元数据文件。视频使用 mp4
格式录制，元数据使用 mcap 格式通过 protobuf 序列化进行录制。

## 如何放置

#### Python

```python
with dai.Pipeline() as pipeline:
    record = pipeline.create(dai.node.RecordVideo)
```

#### C++

```cpp
dai::Pipeline pipeline;
auto record = pipeline.create<dai::node::RecordVideo>();
```

## 输入与输出

## 使用方式

#### Python

```python
with dai.Pipeline() as pipeline:
    record = pipeline.create(dai.node.RecordVideo)
    record.setRecordVideoFile("video.mp4")
    record.setRecordMetadataFile("metadata.mcap")
```

#### C++

```cpp
dai::Pipeline pipeline;
auto record = pipeline.create<dai::node::RecordVideo>();
record->setRecordVideoFile("video.mp4");
record->setRecordMetadataFile("metadata.mcap");
```

## 功能示例

 * [录制视频](https://docs.luxonis.com/software-v3/depthai/examples/record_replay/record_video.md)

## 参考

### dai::node::RecordVideo

Kind: class

RecordVideo node, used to record a video source stream to a file.

#### dai::RecordConfig::CompressionLevel CompressionLevel

Kind: enum

#### Input input

Kind: variable

Input for ImgFrame or EncodedFrame messages to be recorded Default queue is blocking with size 15

#### void run()

Kind: function

#### std::filesystem::path getRecordMetadataFile()

Kind: function

#### std::filesystem::path getRecordVideoFile()

Kind: function

#### CompressionLevel getCompressionLevel()

Kind: function

#### RecordVideo & setRecordMetadataFile(const std::filesystem::path & recordFile)

Kind: function

#### RecordVideo & setRecordVideoFile(const std::filesystem::path & recordFile)

Kind: function

#### RecordVideo & setCompressionLevel(CompressionLevel compressionLevel)

Kind: function

#### RecordVideo & setFps(unsigned int fps)

Kind: function

### 需要帮助？

请前往 [OAKChina 官网](https://www.oakchina.cn/) 获取技术支持或解答您的任何疑问。
