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

# 媒体

> 上传并管理可复用的图片、视频、标志以及片头/片尾片段

媒体是可复用的文件，你可以从预设或项目设置中引用它们。上传一次，然后可在多个项目与导出中重复使用。

## `media add`

将本地文件上传为可复用媒体。

```bash theme={null}
youka media add <file> --as <type>
```

<ParamField path="file" type="string" required>
  你要上传的文件的本地路径。
</ParamField>

<ParamField path="--as" type="string" required>
  `image`、`video`、`logo`、`intro` 或 `outro` 之一。
</ParamField>

### 类型

| 类型      | 描述        |
| ------- | --------- |
| `image` | 静态背景图片    |
| `video` | 循环播放的背景视频 |
| `logo`  | 叠加标志      |
| `intro` | 片头片段      |
| `outro` | 片尾片段      |

### 示例

<CodeGroup>
  ```bash image theme={null}
  youka media add ./background.png --as image --json
  ```

  ```bash intro theme={null}
  youka media add ./intro.mp4 --as intro --json
  ```
</CodeGroup>

## `media list`

列出已认证账号上传的媒体。

```bash theme={null}
youka media list
youka media list --json
```

## `media show`

通过 ID 获取单个媒体条目。

```bash theme={null}
youka media show <mediaId>
youka media show <mediaId> --json
```

## `media delete`

删除已上传的媒体条目。

```bash theme={null}
youka media delete <mediaId> --json
```

<Warning>
  删除媒体不会重写现有项目或导出。它只会阻止后续渲染引用该媒体。
</Warning>

## 下一步

* [Presets](/zh/cli/presets) - 将媒体打包为可复用的渲染设置
* [Projects](/zh/cli/projects) - 通过 `project settings` 应用媒体
