> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-zh/chang-jing-bian-ji-qi/shi-shi-yun-ying/live-streaming.md). Agents can also search and read this documentation through its [MCP server](https://docs.decentraland.org/~gitbook/mcp).

# 直播

使用 Video Screen 和 Admin Tools 将实时视频流传输到场景中。

使用 **视频屏幕** 智能物品搭配 **管理工具** 智能物品，即可将实时视频流传输到场景中。

Decentraland 提供多种将实时视频流传输到场景中的方式：

* **DCL Cast** *（简易模式）*：使用 Decentraland 的免费流媒体 Web 应用，轻松与场景中的其他玩家分享摄像头或屏幕，无需设置流媒体软件。此模式延迟最低，也最容易设置。
* **Stream** *（高级模式）*：使用 [OBS](https://obsproject.com/) 等流媒体软件，通过 Decentraland 的流媒体基础设施进行直播。此模式可让你更灵活地控制直播内容，例如屏幕布局和音频来源。
* **视频 URL** *（高级模式）*：将 URL 粘贴到 **视频 URL** 字段中，指向你自己的流媒体基础设施。

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-907ab22dabdf237cede26b32efa703534a8d0192%2Fstreaming-modes.webp?alt=media" alt="流媒体方式" width="400">

在 Worlds 和 Genesis City 中均可进行流媒体直播，场景端没有观众人数限制。

## 配置场景

以下步骤适用于 DCL Cast 和 Stream 两种方式：

1. 向场景中添加 **视频屏幕** 智能物品。

   ![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-4ffd58cadcc524a13cd567ca4d5ccdc70fc994f2%2Fvideo-player-item.webp?alt=media)
2. 添加 **管理工具** 智能物品，并启用 **视频屏幕** 部分。从下拉菜单中选择每个屏幕，并为其设置一个便于在管理界面中识别的名称。

   ![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-b2e6cf481ed7850bb28891a799dff08cb62c39e4%2Fmulti-video-setup.webp?alt=media)
3. 发布场景（World 或 Genesis City），然后以具有管理员权限的用户身份进入。

   ![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-dd017bc770c17677f9ed9a4bb3b5f366e2bab216%2Fpublish-button.webp?alt=media)

场景发布后，你可以以具有管理员权限的用户身份进入，并配置流媒体设置。

{% hint style="info" %}
**💡 提示**：如果添加多个视频屏幕来显示同一视频，请将其中一个屏幕以外的所有屏幕的来源设置为指向同一个视频播放器，详见 [多个视频屏幕](https://docs.decentraland.org/creator/content-creator-zh/chang-jing-bian-ji-qi/jiao-hu-xing/video-screen.md#multiple-video-screens) 。
{% endhint %}

## DCL Cast（简易模式）

### 共享应用访问权限

以管理员身份进入已发布的场景，并打开管理面板。选择 **视频** 选项卡，然后选择 **DCL Cast** 功能。

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-26e1a45982ee2316827a0ae1732bacb9ff447fa0%2Fdcl-cast.webp?alt=media" alt="DCL Cast" width="400">

你会看到两个可复制并分享给他人的链接。

* **主播**：主播使用此链接将视频投放到场景中。

  <div data-gb-custom-block data-tag="hint" data-style="danger" class="hint hint-danger"><p><strong>❗警告</strong>：请将直播链接视为机密信息，仅分享给你信任的人。如有需要，请在更换演讲者时重置链接。</p><p>直播结束后，请关闭 DCL Cast 浏览器标签页，以释放频道。</p></div>
* **观看者**：此链接供观众通过浏览器或移动设备观看视频。对于目前不在 Decentraland 中的玩家来说，这非常实用。

点击 **复制链接** 按钮，将链接复制到剪贴板。

准备好开始直播时，点击 **激活** 按钮，即可让场景中的观众看到直播。

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-bffafc4dfe2ab434c959e5ded1e751a589dc563b%2Factivate.webp?alt=media" alt="激活直播" width="150">

如果出于任何原因需要重置房间，请点击 **重置房间** 按钮以生成一个新房间。当前正在直播的所有人都会断开连接。

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-7d68402101d2b4cf539eca4a571ad1f3c6f48f3b%2Freset-room.webp?alt=media" alt="重置房间" width="150">

### 使用 DCL Cast 应用

有人在浏览器中粘贴演讲者链接后，会看到类似这样的界面：

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-af60344e747edcc58f2d40d169d0f26e2ce3ac5b%2Fdcl-cast-landing.webp?alt=media" alt="DCL Cast 应用" width="400">

浏览器会请求共享摄像头和麦克风的权限。你还可以配置直播所用的不同输入设备。

{% hint style="info" %}
**📔 提示**：请使用 Google Chrome 或基于 Chrome 内核的浏览器。这些浏览器支持直接从浏览器标签页轻松共享视频和音频。
{% endhint %}

用户可以输入姓名（无需与其 Decentraland 用户名一致），然后点击 **立即加入** 按钮开始直播。

开始直播后，这款应用的操作方式与各种常见的视频会议应用类似，提供静音/取消静音、共享摄像头和屏幕的按钮，以及聊天界面。

聊天内容为只读，并会显示 Decentraland 场景内玩家发送的所有消息。即使你正在使用其他设备直播，也能借此与观众保持联系。

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-0486fed88d8a6efd833fad8fcb90189ea0e274c4%2Fdcl-cast-app.webp?alt=media" alt="DCL Cast 应用" width="700">

在 **参与者** 标签页中，你可以看到三个列表：

* **演讲者**：当前正在向场景直播的人。
* **观看者**：当前通过浏览器观看直播的人。
* **场景内参与者**：当前身处场景中并在场景内观看直播的玩家。

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-fd393377fd8bb1713aac85767433c269823759c1%2Fparticipants.webp?alt=media" alt="参与者标签页" width="200">

如果 DCL Cast 会话中有多位演讲者，场景内的玩家会听到所有演讲者的声音，视频则会自动切换，显示当前正在发声的演讲者，从而始终呈现正在讲话的人。

要覆盖此默认行为：

* 点击场景管理面板中的 **演讲者** 按钮

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-3f94511c71560c7a233689dec5028bf5a68c2acd%2Fspeakers-button.webp?alt=media" alt="参与者标签页" width="200">

* 选择一位演讲者，并选择要展示的来源（该演讲者的摄像头或屏幕）

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-5d8f08c21e62cc2e3eae9bd372d0b5fac0af87e1%2Fselect-speaker-source.webp?alt=media" alt="参与者标签页" width="200">

这样，无论其他演讲者是否正在讲话，所选来源都会始终显示在屏幕上。

{% hint style="info" %}
**📔 提示**：如果你也在场景内观看直播，DCL Cast 应用和 Decentraland 场景同时播放音频可能会造成回声，让人感到不适。你可以点击屏幕左下角的扬声器图标，轻松将 DCL Cast 应用的所有音频静音

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-ddffca54e4ed8e5f901aa2f5f13bf089851fcf61%2Fmute-dcl-cast.webp?alt=media" alt="Participants tab" data-size="original">

你也可以在 Decentraland 设置中将音频静音。
{% endhint %}

### 共享演示文稿

你也可以共享幻灯片演示文稿的内容，将其作为另一种图像来源。

* 在场景内，点击 **共享演示文稿** 按钮（位于 DCL Cast 标签页中）。在 DCL Cast 应用中，点击 **共享屏幕** 按钮和选择框 **共享演示文稿**.

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-14b7e6c47abdb3561606d1012a05658eab62e652%2Fshare-presentation-dcl-cast.webp?alt=media" alt="参与者标签页" width="200">

* 粘贴 Google 幻灯片链接、托管在云端硬盘或类似来源的 .pdf 文件链接，或上传 .pdf 文件。

现在，演示文稿将成为可选择并在屏幕上显示的来源，同时仍能听到所有发言者的声音。

{% hint style="warning" %}
**📔 注意**：演示文稿文件必须小于 100 MB。Google 幻灯片演示文稿必须设为 *公开*.

在一个 DCL Cast 会话中，一次只能有一个演示文稿处于活动状态。
{% endhint %}

随后，你可以切换幻灯片，甚至播放和暂停其中嵌入的任何视频，只需按下 DCL Cast 应用和世界内管理工具界面中都有的按钮即可。

## 直播（高级）

若要在场景中使用直播功能，你需要安装能够向 RTMP 端点输出流的直播软件（例如 [OBS](https://obsproject.com/), [XSplit](https://www.xsplit.com/), [StreamYard](https://streamyard.com/)).

{% hint style="warning" %}
**警告**：单人游戏世界不支持直播。如果你的世界在 Creator Hub 的 **单人游戏** 设置已在世界的 [设置选项卡](https://docs.decentraland.org/creator/content-creator-zh/chang-jing-bian-ji-qi/fa-bu/manage-lands-and-worlds.md#settings) 中启用（或者 `fixedAdapter` 设为了 `"offline:offline"` （位于 `scene.json`中），请先将其禁用，再设置直播。直播功能依赖通信层，而该通信层在单人游戏模式下处于禁用状态。
{% endhint %}

### 获取直播凭据

1. 在场景中打开管理界面（右上角图标）。

   ![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-2901e04790c175df4992f4fcb8e4f333a265a3b9%2Fadmin-icon.webp?alt=media)
2. 在 **视频** 选项卡中，切换到 **直播** 并点击 **获取直播密钥**.

   ![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-705bb2eb6916bcc6273a1487d0417b86f56940f7%2Fget-key.webp?alt=media)
3. 将 **RTMP 服务器** 和 **直播密钥** 复制到你的直播软件中。

   ![OBS configuration](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-1147534dd5fe4215f5122cc0e4bc6a11146c3700%2FOBS-configuration.webp?alt=media)

{% hint style="danger" %}
**❗警告**：同一时间只能有一个人向场景推流。结束直播后，请在软件中点击 **停止直播** 以释放通道。
{% endhint %}

### 开始并控制直播

1. 在直播软件中开始推流。
2. 在管理界面中，点击 **启用** 以在场景中显示直播画面。

   <img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-bffafc4dfe2ab434c959e5ded1e751a589dc563b%2Factivate.webp?alt=media" alt="激活直播" width="100">

### 直播密钥

直播密钥按场景生成，有效期为 4 天（96 小时）。单次直播最长可连续进行 4 小时。

![](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-ea4bbab6f2430819e36ec9bcc244f38e8408320b%2Flive-stream-settings.webp?alt=media)

* 点击 **重置流密钥** 以撤销当前密钥并生成新密钥。正在进行的直播将停止。
* 每个场景都有自己的推流地址和密钥。管理员可以将密钥分享给外部主播。
* 每个场景同一时间只能有一路直播；启动新的直播会覆盖当前直播。

{% hint style="danger" %}
**❗警告**：请将流密钥视为机密信息。如有需要，请在更换演讲者时重置密钥。
{% endhint %}

## 通过 URL 推流（高级）

你也可以将视频屏幕配置为使用 **视频 URL** 选项，然后粘贴流 URL 来进行推流。

你应该可以粘贴指向大多数热门视频网站上视频的 URL。请注意遵守这些平台的服务条款。

若要播放本地设备上的视频文件，最简单的方法是将视频上传到公开的 Google 云端硬盘，然后粘贴链接。

* URL 必须使用 `https`。请参阅 [关于外部推流](https://docs.decentraland.org/creator/content-creator-zh/chang-jing-sdk7/mei-ti/video-playing.md#about-external-streaming).
* 推荐的服务商包括 [Vimeo](https://vimeo.com/), [Bunny](https://bunny.net), [Livepeer Studio](https://livepeer.studio/) 和 [Serraform](https://serraform.gitbook.io/streaming-docs/guides/decentraland-playback).
* 编码器设置提示： [设置 OBS 以顺利推流](https://docs.decentraland.org/creator/content-creator-zh/chang-jing-sdk7/mei-ti/video-playing.md#setting-up-obs-for-successful-streaming).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/creator/content-creator-zh/chang-jing-bian-ji-qi/shi-shi-yun-ying/live-streaming.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
