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

# 启用视频

本节概述了视频功能的前提条件、渲染视频的步骤以及验证视频播放和视频录制的方法。

以下工作流显示了开始视频功能的顺序：

<div className="flex flex-col items-center gap-2">
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/qualcomm-staging/zh/Technologies/Video/media/qli-video-technology/Getting-started-workflow.svg" alt="Figure: Getting started workflow for video" />

  <p className="text-sm text-gray-700">
    **图：视频入门工作流**
  </p>
</div>

工作流概述了初始化和启动基于视频的系统的基本步骤：

1. **前提条件：** 构建并刷写所需的软件，并建立与目标设备的 SSH 连接。
2. **设置：** 从 SSH 终端运行必要的命令，并将预录制的视频推送到设备。
3. **运行：** 运行所需的命令以验证视频播放和录制。

## **前提条件**

* 构建并刷写软件。有关信息，请参阅 [Qualcomm Linux 构建指南](https://dragonwingdocs.qualcomm.com/Key-Documents/Firmware-Guide/build-firmware)。
* 使用 SSH 连接到设备。有关信息，请参阅 ***[使用 SSH 登录](https://dragonwingdocs.qualcomm.com/Key-Documents/Flash-Guide/how-to-sign-in-with-ssh)***

<Expandable title=": 使用 SSH 登录">
  <SignInUsingSsh />
</Expandable>

## **设置视频渲染**

设置过程有助于您在显示器上渲染视频内容并将其传输到设备。

要播放视频，请将预录制的 H.264 视频传输到设备，并从 SSH 终端运行以下命令：

```text theme={null}
scp -r <file_name> root@[DEVICE IP-ADDR]:/opt
```

<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' }}>注意：</p>

  <ul style={{ margin: 0, paddingLeft: '20px' }}>
    <li>视频示例 mp4 片段可以从互联网上外部下载。</li>
    <li>当提示输入密码时，输入 <code>oelinux123</code>。</li>
  </ul>
</div>

## **验证播放和视频录制**

您可以在设备终端上运行一组命令以验证视频播放和录制功能。

**验证视频播放功能**

1. 要验证视频播放功能，请运行以下命令：
   ```text theme={null}
   gst-launch-1.0 filesrc location=/opt/<file_name> ! qtdemux ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! waylandsink fullscreen=true
   ```
2. 要停止验证用例，选择 **<kbd>CTRL</kbd>**<kbd> + C</kbd>。

**验证视频录制功能**

1. 要验证视频录制功能，请运行以下命令：
   ```text theme={null}
   gst-launch-1.0 videotestsrc num-buffers=1000 ! video/x-raw, format=NV12,width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601 ! queue ! v4l2h264enc capture-io-mode=4 output-io-mode=4 extra-controls="controls,video_bitrate=1000000,video_gop_size=29;" ! h264parse ! queue ! mp4mux ! filesink location=/opt/720p_AVC.mp4
   ```
2. 要停止验证用例，选择 **<kbd>CTRL</kbd>**<kbd> + C</kbd>。
3. 要从设备提取录制的内容，请运行以下 Secure Copy Protocol (SCP) 命令：
   ```text theme={null}
   scp -r root@[DEVICE IP-ADDR]:/opt/720p_AVC.mp4 user1@[HOST IP-ADDR]:/workspace
   ```
4. 在主机上播放该内容。

## **后续步骤**

* [构建视频源组件](https://dragonwingdocs.qualcomm.com/Technologies/Video/build-video-source-components)
* [探索视频示例应用](https://dragonwingdocs.qualcomm.com/Technologies/Video/explore-video-sample-applications)
