# Video Stream Consumer

The **Video Stream Consumer** component is designed to consume **`.mp4` video files** either from:

* **Real-time sources** (e.g., live camera feeds via URL), or
* **Stored video files** in an SFTP location.

The component reads and processes videos **frame by frame**, enabling downstream analytics such as object detection, motion tracking, or video-based event recognition.

> **Note**:
>
> * The Video Stream Consumer **only supports `.mp4` file format**.
> * **Testing Pipeline** and **Data Metrics Monitoring** functionalities are **not available** for this component.

### Configuration Sections

All configurations are grouped into:

* **Basic Information**
* **Meta Information**
* **Resource Configuration**

### Basic Information Tab

The *Basic Information* tab defines execution and deployment properties.

| Field                       | Description                                                                                                       | Required    |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------- |
| **Invocation Type**         | Select execution mode: **Batch** or **Real-Time**.                                                                | Yes         |
| **Grace Period (sec)**      | Appears only when *Batch* mode is selected. Specifies the time allowed for the component to shut down gracefully. | Conditional |
| **Intelligent Scaling**     | Appears only when *Real-Time* mode is selected. Enables dynamic scaling based on video processing workload.       | Optional    |
| **Deployment Type**         | Displays the deployment type of the component (pre-selected).                                                     | Yes         |
| **Container Image Version** | Displays the Docker image version used (pre-selected).                                                            | Yes         |
| **Failover Event**          | Select an event to handle errors or retries.                                                                      | Optional    |
| **Batch Size**              | Maximum number of records (frames) processed per execution cycle (minimum: 10).                                   | Yes         |

### Meta Information Tab

The *Meta Information* tab configures video source, authentication, and processing details.

| Field               | Description                                                                                                               | Required    |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------- | ----------- |
| **Host IP Address** | For **SFTP channel**, enter server IP/hostname. For **URL channel**, enter video stream URL (e.g., `rtsp://camera-feed`). | Yes         |
| **Username**        | Username for authentication.                                                                                              | Yes         |
| **Port**            | Port number for the connection (default: 22 for SFTP).                                                                    | Yes         |
| **Authentication**  | Select authentication type: **Password** or **PEM/PPK File**.                                                             | Yes         |
| **Password**        | Password for authentication (if *Password* option is selected).                                                           | Conditional |
| **PEM/PPK File**    | Upload a private key file for authentication (if selected).                                                               | Conditional |
| **Reader Path**     | Path to the video file (for SFTP channel).                                                                                | Yes         |
| **Channel**         | Select channel type: **SFTP** (stored video) or **URL** (live stream).                                                    | Yes         |
| **Resolution**      | Select video resolution (options depend on supported configurations).                                                     | Yes         |
| **Frame Rate**      | Define how many frames per second (fps) to be consumed.                                                                   | Optional    |

> **Note**:
>
> * For **SFTP channel**, Host IP must be a valid server IP.
> * For **URL channel**, Host IP must be a valid video URL.
> * Authentication options dynamically change the required fields (Password or PEM/PPK file).

### Saving the Configuration

* Click **Save Component** (Storage icon).
* A success notification confirms that the component properties have been saved.
* Once saved, the Video Stream Consumer begins consuming video frames and forwarding them to the pipeline workflow.

### Example Workflow

1. Configure the **Video Stream Consumer** with:
   * **Channel**: `URL`
   * **Host IP Address**: `rtsp://192.168.1.100:554/live.sdp`
   * **Resolution**: `720p`
   * **Frame Rate**: `30`
2. Connect the consumer to a **Video Analytics** pipeline for **real-time motion detection**.
3. Output is streamed frame by frame to downstream components for analysis and storage.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bdb.ai/bdb-user-documentation/platform-modules/11.0/data-engineering/data-pipelines/pipeline-editor/pipeline-components/consumers/video-stream-consumer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
