从 Windows Azure 媒体编码器迁移到 Media Encoder StandardMigrate from Windows Azure Media Encoder to Media Encoder Standard

本文介绍了从旧 Windows Azure 媒体编码器 (WAME) 媒体处理器(即将停用)迁移到 Media Encoder Standard 媒体处理器的步骤。This article discusses the steps for migrating from the legacy Windows Azure Media Encoder (WAME) media processor (which is being retired) to the Media Encoder Standard media processor. 有关停用日期,请参阅此旧组件主题。For the retirement dates, see this legacy components topic.

使用 WAME 对文件进行编码时,客户通常使用了命名预设字符串,如 H264 Adaptive Bitrate MP4 Set 1080pWhen encoding files with WAME, customers typically used a named preset string such as H264 Adaptive Bitrate MP4 Set 1080p. 为了进行迁移,需要更新代码以使用 Media Encoder Standard 媒体处理器而不是 WAME,以及一个等效的系统预设(如 H264 Multiple Bitrate 1080p)。In order to migrate, your code needs to be updated to use the Media Encoder Standard media processor instead of WAME, and one of the equivalent system presets like H264 Multiple Bitrate 1080p.

迁移到 Media Encoder StandardMigrating to Media Encoder Standard

下面是使用旧组件的典型 C# 代码示例。Here is a typical C# code sample that uses the legacy component.

// Declare a new job. 
IJob job = _context.Jobs.Create("WAME Job"); 
// Get a media processor reference, and pass to it the name of the  
// processor to use for the specific task. 
IMediaProcessor processor = GetLatestMediaProcessorByName("Windows Azure Media Encoder"); 

// Create a task with the encoding details, using a string preset. 
// In this case " H264 Adaptive Bitrate MP4 Set 1080p" preset is used. 
ITask task = job.Tasks.AddNew("My encoding task", 
    processor, 
    "H264 Adaptive Bitrate MP4 Set 1080p", 
    TaskOptions.None); 

下面是使用 Media Encoder Standard 的已更新版本。Here is the updated version that uses Media Encoder Standard.

// Declare a new job. 
IJob job = _context.Jobs.Create("Media Encoder Standard Job"); 
// Get a media processor reference, and pass to it the name of the  
// processor to use for the specific task. 
IMediaProcessor processor = GetLatestMediaProcessorByName("Media Encoder Standard"); 

// Create a task with the encoding details, using a string preset. 
// In this case " H264 Multiple Bitrate 1080p" preset is used. 
ITask task = job.Tasks.AddNew("My encoding task", 
    processor, 
    "H264 Multiple Bitrate 1080p", 
    TaskOptions.None); 

高级方案Advanced scenarios

如果已使用 WAME 的架构为 WAME 创建了自己的编码预设,则会有一个用于 Media Encoder Standard 的等效架构If you had created your own encoding preset for WAME using its schema, there is an equivalent schema for Media Encoder Standard.

已知差异Known differences

与旧的 WAME 编码器相比,Media Encoder Standard 更强大、更可靠、性能更好且输出质量更好。Media Encoder Standard is more robust, reliable, has better performance, and produces better quality output than the legacy WAME encoder. 另外:In addition,:

  • Media Encoder Standard 生成的输出文件的命名约定与 WAME 不同。Media Encoder Standard produces output files with a different naming convention than WAME.
  • Media Encoder Standard 生成项目,例如包含输入文件元数据输出文件元数据的文件。Media Encoder Standard produces artifacts such as files containing the input file metadata and the output file(s) metadata.
  • 定价页(特别是“常见问题解答”部分)所述,使用 Media Encoder Standard 对视频进行编码时,将根据作为输出产生的文件的持续时间进行计费。As documented on the pricing page (especially in the FAQ section), when you encode videos using Media Encoder Standard, you get billed based on the duration of the files produced as output. 使用 WAME,将根据输入视频文件和输出视频文件的大小进行计费。With WAME, you would be billed based on the sizes of the input video file(s) and output video file(s).

后续步骤Next steps