# Replay Video Node

ReplayVideo host node is used for replaying [recorded
video](https://docs.luxonis.com/software-v3/depthai/depthai-components/host_nodes/record_video.md) to
[ImgFrame](https://docs.luxonis.com/software-v3/depthai/depthai-components/messages/img_frame.md) messages. Video can be replayed
from video files only (mp4, avi, mkv, ...) or from both video and metadata files (recorded using the
[RecordVideo](https://docs.luxonis.com/software-v3/depthai/depthai-components/host_nodes/record_video.md) node).

## How to place it

#### Python

```python
with dai.Pipeline() as pipeline:
    replay = pipeline.create(dai.node.ReplayVideo)
```

#### C++

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

## Inputs and Outputs

## Usage

#### Python

```python
with dai.Pipeline() as pipeline:
    replay = pipeline.create(dai.node.ReplayVideo)
    replay.setReplayVideoFile("video.mp4")
    replay.setReplayMetadataFile("metadata.mcap")
    replay.setOutFrameType(dai.ImgFrame.Type.BGR888i)
    replay.setSize(600, 480)
    replay.setFps(30)
    replay.setLoop(False)
```

#### C++

```cpp
dai::Pipeline pipeline;
auto replay = pipeline.create<dai::node::ReplayVideo>();
replay->setReplayVideoFile("video.mp4");
replay->setReplayMetadataFile("metadata.mcap");
replay->setOutFrameType(dai.ImgFrame.Type.BGR888i);
replay->setSize(600, 480);
replay->setFps(30);
replay->setLoop(False);
```

## Examples of functionality

 * [Replay video](https://docs.luxonis.com/software-v3/depthai/examples/record_replay/replay_video.md)

## Reference

### dai::node::ReplayVideo

Kind: class

Replay node, used to replay a file to a source node.

#### Output out

Kind: variable

Output for any type of messages to be transferred over XLink stream Default queue is blocking with size 8

#### void run()

Kind: function

#### std::filesystem::path getReplayMetadataFile()

Kind: function

#### std::filesystem::path getReplayVideoFile()

Kind: function

#### ImgFrame::Type getOutFrameType()

Kind: function

#### std::tuple< int, int > getSize()

Kind: function

#### float getFps()

Kind: function

#### bool getLoop()

Kind: function

#### ReplayVideo & setReplayMetadataFile(const std::filesystem::path & replayFile)

Kind: function

#### ReplayVideo & setReplayVideoFile(const std::filesystem::path & replayVideo)

Kind: function

#### ReplayVideo & setOutFrameType(ImgFrame::Type outFrameType)

Kind: function

#### ReplayVideo & setSize(std::tuple< int, int > size)

Kind: function

#### ReplayVideo & setSize(int width, int height)

Kind: function

#### ReplayVideo & setFps(float fps)

Kind: function

#### ReplayVideo & setLoop(bool loop)

Kind: function

### Need assistance?

Head over to [Discussion Forum](https://discuss.luxonis.com/) for technical support or any other questions you might have.
