> ## 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 EIS and LDC

> Minimize motion blur and correct lens distortion using GPU-accelerated iWarp processing 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:'#f0fdf4',color:'#166534',padding:'2px 10px',borderRadius:'999px',fontSize:'12px',fontWeight:600}}>Stable</span>
</div>

<CardGroup cols={4}>
  <Card title="EIS" icon="clapperboard">Image Stabilization</Card>
  <Card title="LDC" icon="camera">Distortion Correction</Card>
  <Card title="iWarp" icon="bolt">GPU Accelerated</Card>
  <Card title="OpenGL" icon="microchip">OpenGL API</Card>
</CardGroup>

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

***

## 01 · What Is It?

Electronic Image Stabilization (**EIS**) and Lens Distortion Correction (**LDC**) are advanced image enhancement techniques that mitigate physical artifacts and optical distortions in real-time.

* **EIS**: Minimizes blurring by compensating for device shake. It processes motion data (pitch, yaw, and roll) from the IMU sensor to generate transformation matrices for precise GPU-based warping.
* **LDC**: Corrects geometric distortion introduced by fisheye or wide-angle lenses. It maps curved lines back to straight edges using a static mesh generated during lens calibration.

Both features utilize the **iWarp** library module running on the GPU, leveraging the **OpenGL API** for high-performance image warping.

***

## 02 · Command Options

EIS and LDC can be deployed independently or concurrently using the following `qtiqmmfsrc` parameters:

| GST Command Option | Description                                  |
| :----------------- | :------------------------------------------- |
| `eis=1`            | Enables EIS on the first stream only         |
| `eis=2`            | Enables EIS on two streams                   |
| `ldc=1`            | Enables LDC on all active (1 or 2) streams   |
| `eis=1, ldc=1`     | Enables EIS and LDC on the first stream only |
| `eis=2, ldc=1`     | Enables EIS and LDC on two streams           |

***

## 03 · How Do I Change It?

Follow these steps to initialize the device environment and capture verification logs.

<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">
    Monitor the system journal to verify pipeline state changes and feature initialization.

    ```bash title="On device console" theme={null}
    journalctl -f > /opt/log.txt
    ```
  </Step>

  <Step title="Execute GStreamer Pipeline">
    Choose a use case from the sections below and run the corresponding command.
  </Step>

  <Step title="Verify Feature Status">
    Check the log output for specific CamX and cam-server status strings to confirm the GPU warping nodes are active.
  </Step>
</Steps>

***

## 04 · Feature Validation

### EIS single stream use case

Use the following GStreamer command to enable this use case:

```bash title="GStreamer (EIS Single Stream)" theme={null}
gst-launch-1.0 -e qtiqmmfsrc name=camsrc eis=1 ! \
video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! \
v4l2h264enc capture-io-mode=4 output-io-mode=5 extra-controls="controls,video_bitrate=6000000,\
video_bitrate_mode=0;" ! h264parse ! mp4mux ! filesink location=/opt/cam_1080p.mp4
```

Verify this use case is selected using the following logs:

```text title="Log Verification (EIS Single Stream)" theme={null}
cam-server[926]: [INFO]: RecorderCameraContext : OpenCamera: EIS on single stream is ON..
cam-server[908]: CamX: [ INFO]908 981 [CHI   ] camxchinodeeisdgv26.cpp:1346 Initialize() m_nodeCaps 131072
cam-server[908]: CamX: [CORE_CFG]908 1796 [CORE      ] camxpipeline.h:3024 SetPipelineStatus() RealTimeFeatureZSLPreviewRawYuvEisIoT_0 status is now PipelineStatus::STREAM_ON
```

***

### EIS enabled on first of two streams use case

Use the following GStreamer command to enable this use case:

```bash title="GStreamer (EIS on Stream 1/2)" theme={null}
gst-launch-1.0 -e qtiqmmfsrc name=camsrc eis=1 video_0::type=preview ! \
video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! \
v4l2h264enc capture-io-mode=4 output-io-mode=5 \
extra-controls="controls,video_bitrate=6000000,video_bitrate_mode=0;" ! \
h264parse ! mp4mux ! filesink location=/opt/cam_prev.mp4 camsrc. ! \
video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,\
interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 \
output-io-mode=5 extra-controls="controls,video_bitrate=6000000,video_bitrate_mode=0;" \
! h264parse ! mp4mux ! filesink location=/opt/cam_vid.mp4
```

Verify this use case is selected using the following logs:

```text title="Log Verification (EIS on Stream 1/2)" theme={null}
cam-server[926]: [INFO]: RecorderCameraContext : OpenCamera: EIS on single stream is ON..
cam-server[926]: CamX: [ INFO]926 988 [CHI   ] camxchinodeeisdgv26.cpp:1346 Initialize() m_nodeCaps 131072
cam-server[926]: CamX: [CORE_CFG]926 2529 [CORE      ] camxpipeline.h:3024 SetPipelineStatus() RealTimeFeatureZSLPreviewRawYuvEisIoT_0 status is now PipelineStatus::STREAM_ON
```

***

### EIS enabled on two streams

Use the following GStreamer command to enable this use case:

```bash title="GStreamer (EIS Dual Stream)" theme={null}
gst-launch-1.0 -e qtiqmmfsrc name=camsrc eis=2 video_0::type=preview ! \
video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! \
v4l2h264enc capture-io-mode=4 output-io-mode=5 \
extra-controls="controls,video_bitrate=6000000,video_bitrate_mode=0;" ! \
h264parse ! mp4mux ! filesink location=/opt/cam_prev.mp4 camsrc. ! \
video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,\
interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 \
output-io-mode=5 extra-controls="controls,video_bitrate=6000000,video_bitrate_mode=0;" \
! h264parse ! mp4mux ! filesink location=/opt/cam_vid.mp4
```

Verify this use case is selected using the following logs:

```text title="Log Verification (EIS Dual Stream)" theme={null}
cam-server[914]: [INFO]: RecorderCameraContext : OpenCamera: EIS on dual stream is ON..
cam-server[914]: CamX: [ INFO]914 960 [CHI   ] camxchinodeeisdgv26.cpp:1346 Initialize() m_nodeCaps 131072
cam-server[914]: CamX: [CORE_CFG]914 2421 [CORE      ] camxpipeline.h:3024 SetPipelineStatus() RealTimeFeatureZSLPreviewRawYuvEisIoT_0 status is now PipelineStatus::STREAM_ON
```

***

### LDC single stream use case

Use the following GStreamer command to enable this use case:

```bash title="GStreamer (LDC Single Stream)" theme={null}
gst-launch-1.0 -e qtiqmmfsrc name=camsrc ldc=1 ! \
video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! \
v4l2h264enc capture-io-mode=4 output-io-mode=5 extra-controls="controls,video_bitrate=6000000,\
video_bitrate_mode=0;" ! h264parse ! mp4mux ! filesink location=/opt/cam_1080p.mp4
```

Verify this use case is selected using the following logs:

```text title="Log Verification (LDC Single Stream)" theme={null}
cam-server[926]: [INFO]: RecorderCameraContext : OpenCamera: EIS is disabled cam-server[926]: [INFO]: RecorderCameraContext : OpenCamera: LDC is ON..
cam-server[926]: CamX: [ INFO]926 990 [CHI   ] camxchinodeeisdgv26.cpp:1346 Initialize() m_nodeCaps 524288
cam-server[926]: CamX: [CORE_CFG]926 2132 [CORE      ] camxpipeline.h:3024 SetPipelineStatus() RealTimeFeatureZSLPreviewRawYuvEisIoT_0 status is now PipelineStatus::STREAM_ON
```

***

### LDC enabled on two streams use case

Use the following GStreamer command to enable this use case:

```bash title="GStreamer (LDC Dual Stream)" theme={null}
gst-launch-1.0 -e qtiqmmfsrc name=camsrc ldc=1 video_0::type=preview ! \
video/x-raw,format= NV12,width=1920,height=1080,framerate=30/1 ! \
v4l2h264enc capture-io-mode=4 output-io-mode=5 extra-controls="controls,video_bitrate=6000000,\
video_bitrate_mode=0;" ! h264parse ! mp4mux ! filesink location=/opt/cam_prev.mp4 \
camsrc. ! video/x-raw,format=NV12,width=1280,height=720,\
framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 \
output-io-mode=5 extra-controls="controls,video_bitrate=6000000,video_bitrate_mode=0;" ! \
h264parse ! mp4mux ! filesink location=/opt/cam_vid.mp4
```

Verify this use case is selected using the following logs:

```text title="Log Verification (LDC Dual Stream)" theme={null}
cam-server[914]: [INFO]: RecorderCameraContext : OpenCamera: EIS is disabled cam-server[914]: [INFO]: RecorderCameraContext : OpenCamera: LDC is ON..
cam-server[914]: CamX: [ INFO]914 966 [CHI   ] camxchinodeeisdgv26.cpp:1346 Initialize() m_nodeCaps 524288
cam-server[914]: CamX: [CORE_CFG]914 1591 [CORE      ] camxpipeline.h:3024 SetPipelineStatus() RealTimeFeatureZSLPreviewRawYuvEisIoT_0 status is now PipelineStatus::STREAM_ON
```

***

### EIS and LDC single stream use case

Use the following GStreamer command to enable this use case:

```bash title="GStreamer (EIS + LDC Single Stream)" theme={null}
gst-launch-1.0 -e qtiqmmfsrc name=camsrc eis=1 ldc=1 ! \
video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 \
! v4l2h264enc capture-io-mode=4 output-io-mode=5 extra-controls="controls,video_bitrate=6000000,\
video_bitrate_mode=0;" ! h264parse ! mp4mux ! filesink location=/opt/cam_1080p.mp4
```

Verify this use case is selected using the following logs:

```text title="Log Verification (EIS + LDC Single Stream)" theme={null}
cam-server[914]: [INFO]: RecorderCameraContext : OpenCamera: EIS on single stream is ON..
cam-server[914]: [INFO]: RecorderCameraContext : OpenCamera: LDC is ON.. cam-server[914]: CamX: [CORE_CFG]914 2621 [CORE     ] camxpipeline.h:3024 SetPipelineStatus() RealTimeFeatureZSLPreviewRawYuvEisIoT_0 status is now PipelineStatus::STREAM_ON
```

***

### EIS and LDC enabled on first of two streams use case

Use the following GStreamer command to enable this use case:

```bash title="GStreamer (EIS + LDC on Stream 1/2)" theme={null}
gst-launch-1.0 -e qtiqmmfsrc name=camsrc eis=1 ldc=1 video_0::type=preview ! \
video/x-raw,format= NV12,width=1920,height=1080,framerate=30/1 ! \
v4l2h264enc capture-io-mode=4 output-io-mode=5 extra-controls="controls,video_bitrate=6000000,\
video_bitrate_mode=0;" ! h264parse ! mp4mux ! filesink location=/opt/cam_prev.mp4 camsrc. ! \
video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,\
interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 \
output-io-mode=5 extra-controls="controls,video_bitrate=6000000,video_bitrate_mode=0;" ! \
h264parse ! mp4mux ! filesink location=/opt/cam_vid.mp4
```

Verify this use case is selected using the following logs:

```text title="Log Verification (EIS + LDC on Stream 1/2)" theme={null}
cam-server[2661]: [INFO]: RecorderCameraContext : OpenCamera: EIS on single stream is ON..
cam-server[2661]: CamX: [ INFO]2661 2663 [CHI        ]
camxchinodeeisdgv26.cpp:1346 Initialize() m_nodeCaps 262144
cam-server[2661]: CamX: [CORE_CFG]2661 2834 [CORE ] camxpipeline.h:3024 SetPipelineStatus() RealTimeFeatureZSLPreviewRawYuvEisIoT_0 status is now PipelineStatus::STREAM_ON
```

***

### EIS and LDC enabled on two streams use case

<Warning>
  The EIS and LDC enabled on two streams use case is currently not supported.
</Warning>

Use the following GStreamer command to enable this use case:

```bash title="GStreamer (EIS + LDC Dual Stream)" theme={null}
gst-launch-1.0 -e qtiqmmfsrc name=camsrc eis=2 ldc=1 video_0::type=preview ! \
video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! \
v4l2h264enc capture-io-mode=4 output-io-mode=5 extra-controls="controls,video_bitrate=6000000,\
video_bitrate_mode=0;" ! h264parse ! mp4mux ! filesink location=/opt/cam_prev.mp4 camsrc. ! \
video/x-raw,format=NV12,width=1280,height=720,\
framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc capture-io-mode=4 \
output-io-mode=5 extra-controls="controls,video_bitrate=6000000,video_bitrate_mode=0;" ! \
h264parse ! mp4mux ! filesink location=/opt/cam_vid.mp4
```

Verify this use case is selected using the following logs:

```text title="Log Verification (EIS + LDC Dual Stream)" theme={null}
cam-server[882]: [INFO]: RecorderCameraContext : OpenCamera: EIS on dual stream is ON..
cam-server[882]: CamX: [ INFO]882 977 [CHI   ] camxchinodeeisdgv26.cpp:1346 Initialize() m_nodeCaps 262144
cam-server[882]: CamX: [CORE_CFG]882 1613 [CORE      ] camxpipeline.h:3024 SetPipelineStatus() RealTimeFeatureZSLPreviewRawYuvEisIoT_0 status is now PipelineStatus::STREAM_ON
```
