# Multiple ROI Streams from Single Camera Input Stream

Note

This section is only applicable for QCS6490.

This is an advanced camera control feature that enables 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.

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.
The real-time pipeline produces the full FOV image. The application receives the full FOV image and submits the full FOV buffer back to the camera reprocess pipeline as an input image.
The reprocess pipeline generates up to three ROI images from the full FOV image.

Note

Connect to the device console using SSH. See [How To SSH?](https://docs.qualcomm.com/bundle/publicresource/topics/80-70017-254/how_to.html#use-ssh) for instructions.

To collect the log, run the following command on the device:

# journalctl -f > /opt/log.txt
    Copy to clipboard

To verify the multiple ROI feature:

1. Connect an HDMI monitor to the device.
2. Run the following commands from an SSH terminal to set the display variables:

# export XDG_RUNTIME_DIR=/dev/socket/weston
        # export WAYLAND_DISPLAY=wayland-1
        Copy to clipboard
3. Run the following GStreamer command:

gst-pipeline-app -e 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 ! waylandsink x=0 y=0 width=959 height=540 qos=false sync=false async=true \
        camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! \
        queue ! waylandsink x=960 y=0 width=960 height=540 qos=false sync=false async=true \
        camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! \
        queue ! waylandsink x=0 y=540 width=960 height=540 qos=false sync=false async=true \
        camsrc. ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! \
        queue ! waylandsink x=960 y=540 width=960 height=540 qos=false sync=false async=true
        Copy to clipboard
4. Select **(1) READY**.
5. Select **(3) PLAYING**. Press **Enter**.
6. Select **(p) Plugin Mode**.
7. Select (**13) camsrc**. Four preview streams with Full FOV should be seen.
8. Select **(32) input-roi-info**.
9. Enter the following input:

<1920, 0, 1920, 1080, 0, 1080, 1920, 1080, 0, 0, 1920, 1080>
        Copy to clipboard

One full FOV and three ROI streams should be seen on HDMI.

To close the camera, select **(b) BACK** and then **(q) QUIT**.

Check the following UMD logs to verify this feature is applied on each stream:

cam-server[2810]: CamX: [ INFO]2810 2892 [PPROC ] camxipenode.cpp:2928 FillFrameZoomWindow() ZDBG IPE[3] crop Window [0, 0, 1920, 1080] full size 1920X1080 active 4056X3040, requestId 811 cropType 2 ROI count 3
    cam-server[2810]: CamX: [ INFO]2810 2895 [PPROC ] camxipenode.cpp:2928 FillFrameZoomWindow() ZDBG IPE[2] crop Window [0, 1080, 1920, 1080] full size 1920X1080 active 4056X3040, requestId 811 cropType 1 ROI count 3
    cam-server[2810]: CamX: [ INFO]2810 2891 [PPROC ] camxipenode.cpp:2928
     FillFrameZoomWindow() ZDBG IPE[1] crop Window [1920, 0, 1920, 1080] full size 1920X1080 active 4056X3040, requestId 811 cropType 0 ROI count 3
    Copy to clipboard

Note

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.

Last Published: Dec 31, 2024

[Previous Topic
SHDR, EIS, and LDC Concurrency Use Cases](https://docs.qualcomm.com/bundle/publicresource/80-70017-17/topics/shdr-eis-ldc-concurrency-use-cases.md) [Next Topic
Auto Linear vs. SHDR Mode Switch](https://docs.qualcomm.com/bundle/publicresource/80-70017-17/topics/auto-linear-vs-shdr-mode-switch.md)