> ## 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.

# Build video source components

The video software stack consists of GStreamer plugins and V4L2 components.

V4L2 source components are available in the `meta-qcom-multimedia-image` or `qcom-multimedia-proprietary-image` image as part of the entire software build package. For more information on the procedure to sync and build the `meta-qcom-multimedia` image, see [Qualcomm Linux Build Guide](https://dragonwingdocs.qualcomm.com/Key-Documents/Firmware-Guide/build-firmware).

## **Verify video software**

This section provides information on the video recipe and the steps required to build the VPU driver.

The following BitBake recipe file is used to build the Adreno VPU driver in the `qcom-multimedia-proprietary-image`:

> `<meta-qcom workspace>/recipes-kernel/iris-video-module/iris-video-dlkm_git_<version>.bb`

<div
  style={{
borderLeft: '4px solid #3B5BDB',
backgroundColor: '#EEF2FF',
padding: '12px 16px',
borderRadius: '4px',
marginTop: '12px',
marginBottom: '16px'
}}
>
  <p style={{ margin: '0 0 6px 0', fontWeight: 'bold', color: '#1E3A8A' }}>Note:</p>
  <p style={{ margin: 0 }}><code>version</code> is the latest tag of the recipe. For example: <code>1.0.10</code>, i.e., <code>iris-video-dlkm\_git\_1.0.10.bb</code>.</p>
</div>

### **VPU driver build instructions - `qcom-multimedia-proprietary-image`**

Following are the instructions to apply code changes to the video driver:

1. Follow the steps to create a patch file:
   > a. Clone the video driver repository using the following command:
   >
   > ```text theme={null}
   > git clone https://github.com/qualcomm-linux/video-driver.git -b video.qclinux.main
   > ```
   >
   > b. Change to the cloned repository directory using the following command:
   >
   > ```text theme={null}
   > cd video-driver
   > ```
   >
   > c. Make the required code changes and commit the changes locally.
   >
   > d. Create a patch file from the latest commit using the following command:
   >
   > ```text theme={null}
   > git format-patch HEAD~1
   > ```
   >
   > e. Open the generated patch file and add the following line after signed-off:
   >
   > ```text theme={null}
   > Upstream-Status: Pending
   > ```
   >
   > f. Copy the patch file to following location in the `iris-video-dlkm` recipe.
   >
   > ```text theme={null}
   > recipes-kernel/iris-video-module/iris-video-dlkm/
   > ```
2. Update the `SRC_URI` in the `recipes-kernel/iris-video-module/iris-video-dlkm_<version>.bb` file to include the patch files as follows:
   ```text theme={null}
   SRC_URI = " \
       git://github.com/qualcomm-linux/video-driver.git;protocol=https;branch=video.qclinux.main \
       file://0001-video-driver-follow-v4l2_fh_add-_del-API-changes.patch \
       file://0001-video-driver-stop-playing-tricks-with-Kbuild.patch \
   "
   ```
3. To build the Adreno video driver, run the following commands :
   ```text theme={null}
   kas shell meta-qcom/ci/<MACHINE>:meta-qcom/ci/qcom-distro.yml:meta-qcom/ci/linux-qcom-6.18.yml
   bitbake iris-video-dlkm
   ```
   For example:
   ```text theme={null}
   kas shell meta-qcom/ci/rb3gen2-core-kit.yml:meta-qcom/ci/qcom-distro.yml:meta-qcom/ci/linux-qcom-6.18.yml:meta-qcom/ci/lock.yml
   bitbake iris-video-dlkm
   ```
   <div style={{ borderLeft: '4px solid #3B5BDB', backgroundColor: '#EEF2FF', padding: '12px 16px', borderRadius: '4px', marginTop: '12px' }}>
     <p style={{ margin: '0 0 6px 0', fontWeight: 'bold', color: '#1E3A8A' }}>Note:</p>
     <p style={{ margin: 0 }}>For various <code>\<machine></code> combinations, see <a href="https://dragonwingdocs.qualcomm.com/Key-Documents/Software-Release-Notes/introduction" style={{ color: '#1D4ED8', textDecoration: 'none' }}>Release Notes</a>.</p>
   </div>
4. After compilation, the corresponding `iris_vpu.ko` is available at:
   `<meta-qcom workspace>\build\tmp\sysroots-components\<MACHINE>\iris-video-dlkm\usr\lib\modules\<kernel version>\updates\video\>`
5. Enter the SSH shell and transfer the compiled library to the device using the following command:

   <div style={{ borderLeft: '4px solid #3B5BDB', backgroundColor: '#EEF2FF', padding: '12px 16px', borderRadius: '4px', marginBottom: '12px' }}>
     <p style={{ margin: '0 0 6px 0', fontWeight: 'bold', color: '#1E3A8A' }}>Note:</p>
     <p style={{ margin: 0 }}>You must start the SSH shell to access your Linux host computer. For instructions, see ***Sign in using SSH*** </p>

     <Expandable title="Sign in using SSH">
       <SignInUsingSsh />
     </Expandable>
   </div>

   ```text theme={null}
   mount -o rw,remount /
   ```
6. Change the following command according to your `<workspace-path>`, and the `<IP address of the device>`, and run the following command on the Linux host computer:
   ```text theme={null}
   scp <meta-qcom workspace>\build\tmp\sysroots-components\<MACHINE>\iris-video-dlkm\usr\lib\modules\<kernel version>\updates\video\iris_vpu.ko root@<IP address of the device>/lib/modules/<kernel version>/updates/video/
   ```
   <div style={{ borderLeft: '4px solid #3B5BDB', backgroundColor: '#EEF2FF', padding: '12px 16px', borderRadius: '4px', marginTop: '12px' }}>
     <p style={{ margin: '0 0 6px 0', fontWeight: 'bold', color: '#1E3A8A' }}>Note:</p>
     <p style={{ margin: 0 }}>When prompted for a password, enter <code>oelinux123</code>.</p>
   </div>
7. To see the updated debug changes, power OFF and then power ON the device.

### **VPU driver build instructions - `qcom-multimedia-image`**

Follwing are the instructions to apply code changes to the video driver:

1. Follow the steps to create a patch file:
   > a. Clone kernel where the video driver is available:
   >
   > ```text theme={null}
   > git clone https://github.com/qualcomm-linux/kernel.git
   > ```
   >
   > b. Change to the cloned repository directory:
   >
   > ```text theme={null}
   > cd drivers/media/platform/qcom
   > ```
   >
   > * QCS615 uses: `drivers/media/platform/qcom/venus`.
   > * Dragonwing IQ-8275/Dragonwing IQ-9075/QCS6490 uses: `drivers/media/platform/qcom/iris`
   >
   > c. Make the required code changes and commit the changes locally.
   >
   > d. Create a patch file from the latest commit:
   >
   > ```text theme={null}
   > git format-patch HEAD~1
   > ```
   >
   > e. Open the generated patch file and add the following line after Signed-off:
   >
   > ```text theme={null}
   > Upstream-Status: Pending
   > ```
   >
   > f. Copy the patch file to below location in the kernel recipe.
   >
   > ```text theme={null}
   > <meta qcom workspace>\recipes-kernel\linux\linux-qcom-<kernel version>_git.bb
   > ```
2. Update the `SRC_URI` in the recipe `(.bb)` file to include the patch files as the following:
   ```text theme={null}
   SRC_URI = "git://github.com/qualcomm-linux/kernel.git;${SRCBRANCH};protocol=https"
   SRC_URI += "file://0001-tools-use-basename-to-identify-file-in-gen-mach-type.patch"
   SRC_URI += "file://0001-PR_308.patch"
   ```
3. To build the Adreno video driver, run the following commands:
   ```text theme={null}
   kas shell meta-qcom/ci/<MACHINE>:meta-qcom/ci/qcom-distro-image.yml:meta-qcom/ci/linux-qcom-6.18.yml
   bitbake qcom-multimedia-image
   ```
   For example:
   ```text theme={null}
   kas shell meta-qcom/ci/rb3gen2-core-kit.yml:meta-qcom/ci/qcom-distro.yml:meta-qcom/ci/linux-qcom-6.18.yml:meta-qcom/ci/lock.yml
   bitbake qcom-multimedia-image
   ```
   <div style={{ borderLeft: '4px solid #3B5BDB', backgroundColor: '#EEF2FF', padding: '12px 16px', borderRadius: '4px', marginTop: '12px' }}>
     <p style={{ margin: '0 0 6px 0', fontWeight: 'bold', color: '#1E3A8A' }}>Note:</p>
     <p style={{ margin: 0 }}>For different <code>\<machine></code> combinations, see <a href="https://dragonwingdocs.qualcomm.com/Key-Documents/Software-Release-Notes/introduction" style={{ color: '#1D4ED8', textDecoration: 'none' }}>Release Notes</a>.</p>
   </div>
4. Flash the `qcom-multimedia-image`. For more information, see [Qualcomm Linux Build Guide](https://dragonwingdocs.qualcomm.com/Key-Documents/Firmware-Guide/build-firmware).

## **GStreamer plugins for video**

The Qualcomm IM SDK includes GStreamer plugins for video decoding and encoding. Download the Qualcomm IM SDK to use the `v4l2h264dec`, `v4l2h265dec`, `v4l2h264enc`, `v4l2h265enc`, and `v4l2vp9dec` plugins.

The following table lists the GStreamer plugins and their corresponding reference links:

<div
  style={{
border: '2px solid #0050D8',
borderRadius: '16px',
padding: '24px',
marginTop: '25px',
backgroundColor: '#FFFFFF',
boxShadow: '0 0 25px rgba(0, 80, 216, 0.15)'
}}
>
  <div style={{ borderRadius: '12px', overflow: 'hidden', border: '2px solid #0050D8', width: '100%' }}>
    <div
      style={{
  background: 'linear-gradient(90deg, #0050D8 0%, #0037A5 100%)',
  color: 'white',
  padding: '14px',
  textAlign: 'center',
  fontWeight: 'bold'
}}
    >
      Table: GStreamer plugins for video
    </div>

    <div style={{ width: '100%', display: 'block' }}>
      <table
        style={{
      display: 'table',
      width: '100%',
      minWidth: '100%',
      maxWidth: '100%',
      borderCollapse: 'collapse',
      backgroundColor: 'white',
      tableLayout: 'fixed',
      boxSizing: 'border-box'
    }}
      >
        <colgroup>
          <col style={{ width: '30%' }} />

          <col style={{ width: '70%' }} />
        </colgroup>

        <thead>
          <tr style={{ backgroundColor: '#F8FAFC' }}>
            <th
              style={{
          border: '1px solid #E5E7EB',
          padding: '16px',
          textAlign: 'center',
          fontWeight: 'bold',
          color: '#111827',
          boxSizing: 'border-box'
        }}
            >
              Plug-in
            </th>

            <th
              style={{
          border: '1px solid #E5E7EB',
          padding: '16px',
          textAlign: 'center',
          fontWeight: 'bold',
          color: '#111827',
          boxSizing: 'border-box'
        }}
            >
              Description/reference link
            </th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td style={{ border: '1px solid #E5E7EB', padding: '14px 16px', color: '#111827', fontWeight: '600', boxSizing: 'border-box' }}>
              v4l2h264dec
            </td>

            <td style={{ border: '1px solid #E5E7EB', padding: '14px 16px', boxSizing: 'border-box' }}>
              [Decode the H.264 video stream](https://dragonwingdocs.qualcomm.com/SDKs/IMSDK/plugin-reference/v4l2h264dec)
            </td>
          </tr>

          <tr>
            <td style={{ border: '1px solid #E5E7EB', padding: '14px 16px', color: '#111827', fontWeight: '600', boxSizing: 'border-box' }}>
              v4l2h265dec
            </td>

            <td style={{ border: '1px solid #E5E7EB', padding: '14px 16px', boxSizing: 'border-box' }}>
              [Decode the H.265 video stream](https://dragonwingdocs.qualcomm.com/SDKs/IMSDK/plugin-reference/v4l2h265dec)
            </td>
          </tr>

          <tr>
            <td style={{ border: '1px solid #E5E7EB', padding: '14px 16px', color: '#111827', fontWeight: '600', boxSizing: 'border-box' }}>
              v4l2h264enc
            </td>

            <td style={{ border: '1px solid #E5E7EB', padding: '14px 16px', boxSizing: 'border-box' }}>
              [Encode the H.264 video stream](https://dragonwingdocs.qualcomm.com/SDKs/IMSDK/plugin-reference/v4l2h264enc)
            </td>
          </tr>

          <tr>
            <td style={{ border: '1px solid #E5E7EB', padding: '14px 16px', color: '#111827', fontWeight: '600', boxSizing: 'border-box' }}>
              v4l2h265enc
            </td>

            <td style={{ border: '1px solid #E5E7EB', padding: '14px 16px', boxSizing: 'border-box' }}>
              [Encode the H.265 video stream](https://dragonwingdocs.qualcomm.com/SDKs/IMSDK/plugin-reference/v4l2h265enc)
            </td>
          </tr>

          <tr>
            <td style={{ border: '1px solid #E5E7EB', padding: '14px 16px', color: '#111827', fontWeight: '600', boxSizing: 'border-box' }}>
              v4l2vp9dec
            </td>

            <td style={{ border: '1px solid #E5E7EB', padding: '14px 16px', boxSizing: 'border-box' }}>
              [Decode the VP9 video stream](https://dragonwingdocs.qualcomm.com/SDKs/IMSDK/plugin-reference/v4l2vp9dec)
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>

For information on the steps to download and build, see [Qualcomm Intelligent Multimedia SDK (IM SDK) quickstart](https://dragonwingdocs.qualcomm.com/SDKs/IMSDK/quickstart).

## **Next steps**

* [Troubleshoot video](https://dragonwingdocs.qualcomm.com/Technologies/Video/troubleshoot-video)
