> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enable multiple ROI streams

> Advanced camera control to extract up to three independent Region of Interest (ROI) streams from a single full FOV source on QCS6490.

<div style={{display:'flex',gap:'8px',flexWrap:'wrap',marginBottom:'16px'}}>
  <span style={{background:'#ede9fe',color:'#5b21b6',padding:'2px 10px',borderRadius:'999px',fontSize:'12px',fontWeight:600}}>QCS6490</span>
  <span style={{background:'#fee2e2',color:'#1b996d',padding:'2px 10px',borderRadius:'999px',fontSize:'12px',fontWeight:600}}>Feature Enabled</span>
</div>

<CardGroup cols={3}>
  <Card title="3 ROI + 1 Full" icon="camera-retro">Stream Density</Card>
  <Card title="Reprocess" icon="microchip">Pipeline Logic</Card>
  <Card title="4K Max" icon="bolt">Bandwidth Limit</Card>
</CardGroup>

<Note>
  **Platform Scope:**<br />
  This section is only applicable for **QCS6490**.
</Note>

***

## 01 · What Is It?

This is an advanced camera control feature that allows the user to get multiple ROI streams from a single camera with each stream showing a different ROI from the full FOV. It supports up to three cropped ROI streams and one full ROI stream.

### Architecture Logic

In case of three ROIs, the app sends five streams to configure, with one full FOV output stream, one input stream, and three ROI output streams.

* **Real-time Pipeline:** Produces the initial full FOV image.
* **Buffer Feedback:** The application receives the full FOV image and submits the buffer back to the camera reprocess pipeline as an input image.
* **Reprocess Pipeline:** Generates up to three ROI images from the full FOV source.

***

## 02 · Setup & Initialization

<Note>
  Connect to the device console using SSH. See [How To SSH?](https://dragonwingdocs.qualcomm.com/Linux/devices/iq9075-evk/set-up-the-device#connect-over-ssh) for instructions.
</Note>

<Steps>
  <Step title="Initialize Log Collection">
    To collect the log, run the following command on the device:

    ```bash Log Collection theme={null}
    # journalctl -f > /opt/log.txt
    ```
  </Step>
</Steps>

***

## 03 · Feature Validation

<Steps>
  <Step title="Execute ROI Pipeline">
    Run the following GStreamer command:

    ```bash GStreamer (Multiple ROI Pipeline) theme={null}
    gst-pipeline-app qtivcomposer name=mixer sink_0::position="<0, 0>" sink_0::dimensions="<960, 540>" \
    sink_1::position="<960, 0>" sink_1::dimensions="<960, 540>" \
    sink_2::position="<0, 540>" sink_2::dimensions="<960, 540>" \
    sink_3::position="<960, 540>" sink_3::dimensions="<960, 540>" mixer. ! queue ! \
    waylandsink qos=false sync=false fullscreen=true \
    qtiqmmfsrc input-roi-enable=true video_0::type=preview video_1::type=preview \
    video_2::type=preview video_3::type=preview video_0::reprocess-enable=true \
    name=camsrc ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! queue ! mixer. \
    camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! queue ! mixer. \
    camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! queue ! mixer. \
    camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! queue ! mixer.
    ```
  </Step>

  <Step title="State Initialization">
    1. Select **(1) READY**.
    2. Select **(3) PLAYING**. Press **Enter**.
  </Step>

  <Step title="Interactive Plugin Configuration">
    1. Select **(p) Plugin Mode**.
    2. Select **(12) camsrc**. You should see four preview streams with Full FOV.
    3. Select **(32) input-roi-info**.
  </Step>

  <Step title="Define Region of Interest">
    Enter the following input:

    ```text ROI Input String theme={null}
    <1920, 0, 1920, 1080, 0, 1080, 1920, 1080, 0, 0, 1920, 1080>
    ```

    You should see one full FOV and three ROI streams on HDMI.
  </Step>

  <Step title="Termination">
    To close the camera, select **(b) BACK** and then **(q) QUIT**.
  </Step>

  <Step title="Log Verification">
    Check the following UMD logs to verify multiple ROI pipeline is selected:

    ```text Log Verification (Pipeline Status) theme={null}
    cam-server[2218]: CamX: [CORE_CFG]2218 2368 [CORE   ] camxpipeline.h:3024 SetPipelineStatus() ZSLReprocessYuvToYuvMultiRoIStreams_0 status is now PipelineStatus::STREAM_ON
    ```
  </Step>
</Steps>

<Note>
  **Performance Constraint**\
  The total bandwidth for the Full FOV stream + ROI streams needs to be less than 4K, which is the max capability of the QCS6490 chipset.
</Note>
