Azure Media Indexer 的任务预设Task preset for Azure Media Indexer

Azure Media Indexer 是用于执行以下任务的媒体处理器:使媒体文件和内容可搜索、生成隐藏式字幕跟踪和关键字、为属于你的资产的资产文件编制索引。Azure Media Indexer is a Media Processor that you use to perform the following tasks: make media files and content searchable, generate closed captioning tracks and keywords, index asset files that are part of your asset.

本主题介绍需要传入索引作业的任务预设。This topic describes the task preset that you need to pass to your indexing job. 有关完整示例,请参阅使用 Azure Media Indexer 为媒体文件编制索引For complete example, see Indexing media files with Azure Media Indexer.

Azure Media Indexer 配置 XMLAzure Media Indexer Configuration XML

下表说明了配置 XML 的元素和属性。The following table explains elements and attributes of the configuration XML.

名称Name 必需Require 说明Description
输入Input truetrue 要编制索引的资产文件。Asset file(s) that you want to index.
Azure Media Indexer 支持以下格式的媒体文件:MP4、MOV、WMV、MP3、M4A、WMA、AAC、WAV。Azure Media Indexer supports the following media file formats: MP4, MOV, WMV, MP3, M4A, WMA, AAC, WAV.

可以在 input 元素的 namelist 属性中指定文件名(如下所示)。You can specify the file name (s) in the name or list attribute of the input element (as shown below). 如果未指定要编制索引的资产文件,系统会选择主文件。If you do not specify which asset file to index, the primary file is picked. 如果未设置主资产文件,则为输入资产中的第一个文件编制索引。If no primary asset file is set, the first file in the input asset is indexed.

若要显式指定资产文件名,请执行:To explicitly specify the asset file name, do:
<input name="TestFile.wmv" />

还可以一次为多个资产文件编制索引(最多 10 个文件)。You can also index multiple asset files at once (up to 10 files). 为此,请按以下步骤操作:To do this:
- 创建一个文本文件(清单文件),并为其指定扩展名 .lst。- Create a text file (manifest file) and give it an .lst extension.
- 将输入资产中所有资产文件名的列表添加到此清单文件。- Add a list of all the asset file names in your input asset to this manifest file.
- 将该清单文件添加(上传)到资产。- Add (upload) the manifest file to the asset.
- 在输入的列表属性中指定清单文件的名称。- Specify the name of the manifest file in the input’s list attribute.
<input list="input.lst">

注意: 如果在清单文件中添加了 10 个以上的文件,则索引作业会失败并显示 2006 错误代码。Note: If you add more than 10 files to the manifest file, the indexing job will fail with the 2006 error code.
metadatametadata falsefalse 指定的资产文件的元数据。Metadata for the specified asset file(s).
<metadata key="..." value="..." />

可以提供预定义键的值。You can supply values for predefined keys.

当前支持以下键:Currently, the following keys are supported:

titledescription - 用于更新语言模型,以改进语音识别准确性。title and description - used to update the language model to improve speech recognition accuracy.
<metadata key="title" value="[Title of the media file]" /><metadata key="description" value="[Description of the media file]" />

usernamepassword - 在通过 http 或 https 下载 Internet 文件时用于身份验证。username and password - used for authentication when downloading internet files via http or https.
<metadata key="username" value="[UserName]" /><metadata key="password" value="[Password]" />
username 和 password 值应用到输入清单中的所有媒体 URL。The username and password values apply to all media URLs in the input manifest.
featuresfeatures

在版本 1.2 中添加。Added in version 1.2. 目前,唯一支持的功能是语音识别(“ASR”)。Currently, the only supported feature is speech recognition ("ASR").
falsefalse 语音识别功能具有以下设置键:The Speech Recognition feature has the following settings keys:

Language:Language:
- 要在多媒体文件中识别的自然语言。- The natural language to be recognized in the multimedia file.
- 英语、西班牙语- English, Spanish

CaptionFormats:CaptionFormats:
- 以分号分隔的所需输出字幕格式的列表(如果有)- a semicolon-separated list of the desired output caption formats (if any)
- ttml;webvtt- ttml;webvtt


GenerateKeywords:GenerateKeywords:
- 布尔标志,指定是否需要关键字 XML 文件。- A boolean flag specifying whether or not a keyword XML file is required.
- True;False。- True; False.

Azure Media Indexer 配置 XML 示例Azure Media Indexer configuration XML example

<?xml version="1.0" encoding="utf-8"?>  
<configuration version="2.0">  
  <input>  
    <metadata key="title" value="[Title of the media file]" />  
    <metadata key="description" value="[Description of the media file]" />  
  </input>  
  <settings>  
  </settings>  
  
  <features>  
    <feature name="ASR">    
      <settings>  
        <add key="Language" value="English"/>  
        <add key="GenerateKeywords" value ="true" />  
      </settings>  
    </feature>  
  </features>  
  
</configuration>  

后续步骤Next steps

参阅使用 Azure Media Indexer 为媒体文件编制索引See Indexing media files with Azure Media Indexer.