有关从媒体服务 v2 迁移到 v3 的指导Migration guidance for moving from Media Services v2 to v3

媒体服务徽标 v3media services logo v3

通过将此 URL (https://docs.microsoft.com/api/search/rss?search=%22Migrate+from+Azure+Media+Services+v2+to+v3%22&locale=en-us) 复制并粘贴到 RSS 源阅读器中获取有关何时重新访问此页以获得更新的通知。Get notified about when to revisit this page for updates by copying and pasting this URL: https://docs.microsoft.com/api/search/rss?search=%22Migrate+from+Azure+Media+Services+v2+to+v3%22&locale=en-us into your RSS feed reader.

本文提供了从媒体服务 v2 迁移到 v3 的迁移指南。This article provides the migration guidance from Media Services v2 to v3.

如果你目前基于旧版媒体服务 v2 API 开发了一个视频服务,则在迁移到 v3 API 之前,应查看以下指导原则和注意事项。If you have a video service developed today on top of the legacy Media Services v2 APIs, you should review the following guidelines and considerations prior to migrating to the v3 APIs. v3 API 中的许多优势和新功能可以改进开发体验和媒体服务的功能。There are many benefits and new features in the v3 API that improve the developer experience and capabilities of Media Services. 但是,如本文的已知问题部分中所述,API 版本的变化也带来了一些限制。However, as called out in the Known Issues section of this article, there are also some limitations due to changes between the API versions. 在媒体服务团队不断改进 v3 API 并解决版本差距的过程中,本页面会得到维护。This page will be maintained as the Media Services team makes continued improvements to the v3 APIs and addresses the gaps between the versions.


媒体服务 v3 的优势Benefits of Media Services v3

API 更便于访问API is more approachable

  • v3 基于一个统一的 API 接口,该接口公开了基于 Azure 资源管理器构建的管理和操作功能。v3 is based on a unified API surface, which exposes both management and operations functionality built on Azure Resource Manager. Azure 资源管理器模板可用于创建和部署转换、流式处理终结点、直播活动等等。Azure Resource Manager templates can be used to create and deploy Transforms, Streaming Endpoints, Live Events, and more.
  • OpenAPI 规范(以前称为 Swagger)文档。OpenAPI Specification (formerly called Swagger) document. 公开所有服务组件的架构,包括基于文件的编码。Exposes the schema for all service components, including file-based encoding.
  • 适用于 .NET、.NET Core、Node.jsPythonJavaGo 和 Ruby 的 SDK。SDKs available for .NET, .NET Core, Node.js, Python, Java, Go, and Ruby.
  • 简化脚本支持的 Azure CLI 集成。Azure CLI integration for simple scripting support.

新增功能New features

  • 对于基于文件的作业处理,可以使用 HTTP(S) URL 作为输入。For file-based Job processing, you can use a HTTP(S) URL as the input.
    无需事先在 Azure 中存储内容,无需创建资产。You do not need to have content already stored in Azure, nor do you need to create Assets.
  • 为基于文件的作业处理引入了转换的概念。Introduces the concept of Transforms for file-based Job processing. 使用转换可以生成可重用的配置、创建 Azure 资源管理器模板,并隔离多个客户或租户之间的处理设置。A Transform can be used to build reusable configurations, to create Azure Resource Manager Templates, and isolate processing settings between multiple customers or tenants.
  • 一个资产可以有多个流式处理定位符,其中每个流式处理定位符有不同的动态打包和动态加密设置。An Asset can have multiple Streaming Locators each with different Dynamic Packaging and Dynamic Encryption settings.
  • 内容保护支持多密钥功能。Content protection supports multi-key features.
  • 使用媒体服务将单比特率贡献源转码为具有多比特率的输出流时,可以流式传输最长 24 小时的直播活动。You can stream Live Events that are up to 24 hours long when using Media Services for transcoding a single bitrate contribution feed into an output stream that has multiple bitrates.
  • 直播活动支持新的低延迟实时传送视频流。New Low Latency live streaming support on Live Events. 有关详细信息,请参阅延迟For more information, see latency.
  • 直播活动预览版支持动态打包和动态加密。Live Event Preview supports Dynamic Packaging and Dynamic Encryption. 这样,用户便可以使用预览版中的内容保护以及 DASH 和 HLS 打包。This enables content protection on Preview as well as DASH and HLS packaging.
  • 与 v2 API 中的节目实体相比,实时输出更易于使用。Live Output is simpler to use than the Program entity in the v2 APIs.
  • 改进的 RTMP 支持(提高了稳定性并提供了更多的源编码器支持)。Improved RTMP support (increased stability and more source encoder support).
  • RTMPS 安全引入。RTMPS secure ingest.
    创建直播活动时,将获得 4 个引入 URL。When you create a Live Event, you get 4 ingest URLs. 这 4 个引入 URL 几乎是相同的,具有相同的流式处理令牌 (AppId),仅端口号部分不同。The 4 ingest URLs are almost identical, have the same streaming token (AppId), only the port number part is different. 其中两个 URL 是 RTMPS 的主要和备份 URL。Two of the URLs are primary and backup for RTMPS.
  • 可对实体使用基于角色的访问控制 (RBAC)。You have role-based access control (RBAC) over your entities.

已知问题Known issues

  • 目前,可以使用 Azure 门户执行以下操作:Currently, you can use the Azure portal to:

    对于其他所有管理任务(例如,转换和作业内容保护),请使用 REST APICLI 或某个受支持的 SDKFor all other management tasks (for example, Transforms and Jobs and Content protection), use the REST API, CLI, or one of the supported SDKs.

  • 需要在帐户中预配媒体预留单位 (MRU) 才能控制作业的并发和性能,特别是涉及到视频或音频分析的那些作业。You need to provision Media Reserved Units (MRUs) in your account in order to control the concurrency and performance of your Jobs, particularly ones involving Video or Audio Analysis. 有关详细信息,请参阅缩放媒体处理For more information, see Scaling Media Processing. 可以使用适用于媒体服务 v3 的 CLI 2.0、使用 Azure 门户v2 API 来管理 MRU。You can manage the MRUs using CLI 2.0 for Media Services v3, using the Azure portal, or using the v2 APIs. 无论使用的是媒体服务 v2 还是 v3 API,都需要预配 MRU。You need to provision MRUs, whether you are using Media Services v2 or v3 APIs.

  • 无法使用 v2 API 来管理通过 v3 API 创建的媒体服务实体。Media Services entities created with the v3 API cannot be managed by the v2 API.

  • 并非 V2 API 中的所有实体都自动出现在 V3 API 中。Not all entities in the V2 API automatically show up in the V3 API. 以下是这两个版本中不兼容的实体的示例:Following are examples of entities in the two versions that are incompatible:

    • 在 v2 中创建作业和任务不会在 v3 中显示,因为它们不与转换相关联。Jobs and Tasks created in v2 do not show up in v3 as they are not associated with a Transform. 建议切换到 v3 转换和作业。The recommendation is to switch to v3 Transforms and Jobs. 在切换过程中,需要花费一段相对较短的时间来监视即时 v2 作业。There will be a relatively short time period of needing to monitor the inflight v2 Jobs during the switchover.
    • 无法持续使用 v3 来管理通过 v2 创建的频道和节目(映射到 v3 中的直播活动和实时输出)。Channels and Programs created with v2 (which are mapped to Live Events and Live Outputs in v3) cannot continue being managed with v3. 建议在方便停止频道时切换到 v3 直播活动和实时输出。The recommendation is to switch to v3 Live Events and Live Outputs at a convenient Channel stop.
      目前,无法持续迁移正在运行的频道。Presently, you cannot migrate continuously running Channels.


在媒体服务团队不断改进 v3 API 并解决版本差距的过程中,本页面会得到维护。This page will be maintained as the Media Services team makes continued improvements to the v3 APIs and addresses the gaps between the versions.

后续步骤Next steps

教程:基于 URL 对远程文件进行编码并流式传输视频 - .NETTutorial: Encode a remote file based on URL and stream the video - .NET