您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

基于编码方案的迁移指南Encoding scenario-based migration guidance

迁移指南徽标


迁移步骤 2

本文提供基于编码方案的指南,可帮助你从 Azure 媒体服务 v2 迁移到 v3。This article gives you encoding scenario based guidance that will assist you in migrating from Azure Media Services v2 to v3.

先决条件Prerequisites

在开始更改编码工作流之前,建议了解存储管理方式的区别。Before you get into changing your encoding workflow, it's recommended that you understand the differences in the way storage is managed. 在 AMS V3 中,Azure 存储 API 用于管理与媒体服务帐户关联的存储帐户。In AMS V3, the Azure Storage API is used to manage the storage account(s) associated with your Media Services account.

备注

在 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.

编码工作流比较Encoding workflow comparison

请花几分钟时间查看下面的流程图,以直观地比较 V2 和 V3 的编码工作流。Take a few minutes to look at the flowcharts below for a visual comparison of the encoding workflows for V2 and V3.

V2 编码工作流V2 encoding workflow

单击下面的图像查看大图。Click on the image below to see a larger version.

V2 编码工作流 Encoding workflow for V2

  1. 设置Setup
    1. 创建资产或使用现有资产。Create an asset or use and existing asset. 如果使用新资产,请将内容上传到该资产。If using a new asset, upload content to that asset. 如果使用现有资源,则应该对资产中已存在的文件进行编码。If using an existing asset, you should be encoding files that already exist in the asset.
    2. 获取以下项的值:Get the values of the following items:
      • 媒体处理器 ID 或对象Media processor ID or object
      • 要使用的编码器的编码器字符串(名称)Encoder string (name) of the encoder you want to use
      • 新资产的资产 ID 或现有资产的资产 IDAsset ID of new asset OR the asset ID of the existing asset
    3. 对于监视,请创建作业或任务级别的通知订阅或 SDK 事件处理程序For monitoring, create either a job or task level notification subscription or an SDK event handler
  2. 创建包含任务的作业。Create the job that contains the task or tasks. 每项任务应包括上述各项和:Each task should include the above items and:
    • 需要创建输出资产的指令。A directive that an output asset needs to be created. 输出资产由系统创建。The output asset is created by the system.
    • 输出资产的可选名称Optional name for the output asset
  3. 提交作业。Submit the job.
  4. 监视作业。Monitor the job.

V3 编码工作流V3 encoding workflow

V3 编码工作流Encoding workflow for V3

  1. 设置Set up
    1. 创建资产或使用现有资产。Create an asset or use an existing asset. 如果使用新资产,请将内容上传到该资产。If using a new asset, upload content to that asset. 如果使用现有资源,则应该对资产中已存在的文件进行编码。If using an existing asset, you should be encoding files that already exist in the asset. 不应将更多内容上传到该资产。You shouldn't upload more content to that asset.
    2. 创建输出资产。Create an output asset. 输出资产是编码文件以及输入和输出元数据的存储位置。The output asset is where the encoded files and input and output metadata will be stored.
    3. 获取转换的值:Get values for the transform:
      • 标准编码器预设Standard Encoder preset
      • AMS 资源组AMS resource group
      • AMS 帐户名称AMS account name
    4. 创建转换或使用现有转换。Create the transform or use an existing transform. 转换是可重用的。Transforms are reusable. 每次要提交作业时,都不必创建新的转换。It isn't necessary to create a new transform each time you want to submit a job.
  2. 创建作业Create a job
    1. 为作业获取以下各项的值:For the job, get the values for the following items:
      • 转换名称Transform name
      • 资产的 SAS URL、文件共享的 HTTPs 源路径或文件的本地路径的基本 URI。Base-URI for the SAS URL for your asset, the HTTPs source path of your file share, or the local path of the files. JobInputAsset 还可以使用资产名称作为输入。The JobInputAsset can also use an asset name as an input.
      • 文件名File name(s)
      • 输出资产Output asset(s)
      • 资源组A resource group
      • AMS 帐户名称AMS account name
  3. 使用事件网格来监视作业。Use Event Grid for monitoring your job.
  4. 提交作业。Submit the job.

从 V2 到 V3 编码的自定义预设Custom presets from V2 to V3 encoding

如果你的 V2 代码使用自定义预设调用了标准编码器,则在提交作业之前,首先需要使用自定义标准编码器预设创建新的转换。If your V2 code called the Standard Encoder with a custom preset, you first need to create a new transform with the custom Standard Encoder preset before submitting a job.

自定义预设现在为 JSON,不再基于 XML。Custom presets are now JSON and no longer XML based. 按照转换 Open API (Swagger) 文档中定义的自定义预设架构,在 JSON 中重新创建预设。Recreate your preset in JSON following the custom preset schema as defined in the Transform Open API (Swagger) documentation.

编码作业中的输入和输出元数据文件Input and output metadata files from an encoding job

在 v2 中,XML 输入和输出元数据文件将作为编码作业的结果生成。In v2, XML input and output metadata files get generated as the result of an encoding job. 在 v3 中,元数据格式已从 XML 更改为 JSON。In v3, the metadata format changed from XML to JSON. 有关元数据的详细信息,请参阅输入元数据输出元数据For more information about metadata, see Input metadata and Output metadata.

高级编码器到 v3 标准编码器或基于合作伙伴的解决方案Premium Encoder to v3 Standard Encoder or partner-based solutions

v2 API 不再支持高级编码器。The v2 API no longer supports the Premium Encoder. 如果以前使用基于工作流的高级编码器进行 HEVC 编码,则应迁移到支持 HEVC 编码的新 v3 标准编码器If you previously used the workflow-based Premium Encoder for HEVC encoding should migrate to the new v3 Standard Encoder with HEVC encoding support.

如果需要高级编码器的高级工作流功能,建议你开始使用来自 Imagine CommunicationsTelestreamBitmovin 的 Azure 高级编码合作伙伴解决方案。If you require the advanced workflow features of the Premium Encoder, you're encouraged to start using an Azure advanced encoding partner solution from Imagine Communications, Telestreamor Bitmovin.

具有 HTTPS 托管 URL 上的输入的作业Jobs with inputs that are on HTTPS hosted URLs

现在,可以使用 HTTP 作业输入支持从存储在 Azure 存储、本地存储或外部 Web 服务器中的文件提交 V3 中的作业。You can now submit jobs in V3 from files stored either in Azure storage, stored locally, or external web servers using the HTTP(S) job input support.

如果以前在提交作业之前使用工作流将文件从 Azure blob 文件复制到空资产中,则可以通过将 Azure blob 存储中的文件的 SAS URL 直接传递到作业中来简化工作流。If you previously used workflows to copy files from Azure blob files into empty assets before submitting jobs, you may be able to simplify your workflow by passing a SAS URL for the file in Azure blob storage directly into the job.

索引器 v1 音频听录到新 AudioAnalyzer“基本模式”Indexer v1 audio transcription to the new AudioAnalyzer “basic mode”

对于在 v2 API 中使用索引器 v1 处理器的客户,需要创建一个转换,以在提交作业之前以基本模式调用新的 AudioAnalyzerFor customers using the Indexer v1 processor in the v2 API, you need to create a transform that invokes the new AudioAnalyzer in basic mode prior to submitting a Job.

编码、转换和作业概念、教程以及操作方法指南Encoding, transforms and jobs concepts, tutorials and how to guides

概念Concepts

教程Tutorials

操作方法指南How to guides

示例Samples

还可将代码示例中的 V2 和 V3 代码进行比较You can also compare the V2 and V3 code in the code samples.