> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/latex/zh-cn/wen-da/14-how-can-i-embed-a-video-in-my-pdf-using-latex.md).

# 如何使用 LaTeX 在我的 PDF 中嵌入视频？

以前可以通过以下方式实现： [`media9` 包](https://ctan.org/pkg/media9?lang=en) 但由于 Adobe 于 2020 年底停止支持 Flash， **该** [**`media9` 包**](https://ctan.org/pkg/media9?lang=en) **依赖 Flash 的版本不应再使用** 将视频或其他多媒体内容嵌入由 LaTeX 生成的 PDF 文件中，包括在 Overleaf 上创建的任何项目。不过，很可能 `media9` 包 [会由其作者更新](https://gitlab.com/agrahn/media9) 以使用不基于 Flash 的方法将视频嵌入由 LaTeX 生成的 PDF 中。

## 不基于 Flash 的视频嵌入：概念验证

……的作者 `media9` 发布了一个 [在 tex.stackexchange 上发布的概念验证示例](https://tex.stackexchange.com/a/516102) 演示了如何使用一种不依赖 Flash 的技术将视频嵌入 PDF 中。可在以下位置找到演示该代码的一个 Overleaf 项目 [这里](https://www.overleaf.com/read/rcfqksxktygc)——请注意，视频不会在 Overleaf 的预览面板中播放；请下载 PDF，并在合适的查看器中打开，例如 Adobe Reader。

## 截至 2021 年 2 月的情况

随着 Flash 最近正式终止支持，PDF 中嵌入的视频或声音的播放现在依赖于主机操作系统内置的音视频播放软件。Flash 退役后，嵌入 PDF 的视频播放技术环境仍较为多变，尤其是对依赖 Windows 10 的用户而言，因为某些 Windows 10 安装存在视频播放问题。针对 Windows 10 的一个变通方法是 [于 2021 年 2 月 10 日发布在 Adobe 支持社区论坛上](https://community.adobe.com/t5/acrobat-reader/playing-embedded-video-without-flash/td-p/11266205/page/2)——你需要查找同一天由 Himanshu Sagar 发布的条目。

……的作者 `media9` 包已指出（[这里](https://stackoverflow.com/a/64789038) 和 [这里](https://tex.stackexchange.com/a/516102)）到， *就目前而言*，最佳做法可能是提供视频文件链接，而不是将其嵌入。选择在 PDF 中提供视频内容链接的用户，需要确保任何阅读你的 PDF 文档的人都能访问这些视频。

关于 PDF 中嵌入的视频内容在 Flash 退役后的现状的进一步讨论，例如 `.mp4` 文件，可在 [Adobe 在线论坛中找到](https://community.adobe.com/t5/acrobat-reader/playing-embedded-video-without-flash/td-p/11266205)。对于 LaTeX 用户，可在 tex.stackexchange 上找到更多信息和讨论：

* [Media9 在 2020 年 12 月开始变得过时。有没有在 LaTeX 中嵌入视频/音频的替代方案？](https://tex.stackexchange.com/questions/516029/media9-is-becoming-obsolete-dec-2020-any-alternatives-for-embedding-video-audio/)
* [Overleaf 中 2020 年 12 月之后 media9 的替代方案](https://tex.stackexchange.com/questions/577986/alternatives-for-media9-after-dec-2020-in-overleaf)

## PDF 中的 Flash：简要背景与历史

Adobe 于 2005 年收购了名为 Macromedia 的公司，从而获得了 Flash 技术（见 [维基百科](https://en.wikipedia.org/wiki/Macromedia) 或 [这里](https://www.adexchanger.com/data-driven-thinking/flash-in-the-pan-historical-lessons-of-adobes-macromedia-acquisition/) ，了解历史和概述）。2008 年 6 月，Adobe 发布了一项 [对 ISO 32000 PDF 规范的扩展](https://www.adobe.com/content/dam/acom/en/devnet/pdf/adobe_supplement_iso32000.pdf) 该扩展为 PDF 文件引入了对嵌入 Flash 内容的支持，为 PDF 文件包含各种形式的“富媒体”提供了一种便捷方式，包括视频、声音和 Flash 动画。PDF 规范的这些扩展与 [Adobe Reader 9 的发布](https://en.wikipedia.org/wiki/Adobe_Acrobat_version_history) 相吻合，当时它支持查看和播放嵌入式基于 Flash 的“富媒体”。

Flash 曾是一项极其流行的技术，用于创建、嵌入和共享丰富的交互式内容——包括网页中的内容——但随着时间推移，对 Flash 的支持逐渐减少，新的开放 Web 技术和标准不断出现，进一步削弱了 Flash 在技术组合中的作用。最终，局势在 2017 年 7 月 25 日变得明朗，当时 Adobe [宣布](https://blog.adobe.com/en/publish/2017/07/25/adobe-flash-update.html) 其对 Flash 的支持将在 2020 年底停止。如今，Adobe 最新的 PDF 产品已不再支持嵌入或播放（显示）基于 Flash 的媒体格式——`*.flv` 和 `*.swf` 文件。另见 [Flash Player 生命周期终结：对 Reader 和 Acrobat 的影响](https://helpx.adobe.com/uk/acrobat/kb/flash-format-support-in-pdf.html).

从技术角度看，并没有什么能阻止你通过 LaTeX 宏包或通过你自己定制的宏（它们会将相应的操作符注入输出 PDF 文件）将基于 Flash 的媒体嵌入 PDF 中——但你的内容不会受到支持，因此通过当前及未来各代 PDF 查看应用程序也无法供读者使用。


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/latex/zh-cn/wen-da/14-how-can-i-embed-a-video-in-my-pdf-using-latex.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
