ALIYUN::MPS::TranscodeJob

更新时间:
复制为 MD 格式

ALIYUN::MPS::TranscodeJob类型用于提交转码作业。

语法

{
  "Type": "ALIYUN::MPS::TranscodeJob",
  "Properties": {
    "Input": Map,
    "OutputBucket": String,
    "Outputs": List,
    "PipelineId": String,
    "OutputLocation": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Input

Map

作业输入。

详细说明,请参见 参数详情

  • OSS 的地域需要与当前 MPS 所在地域保持一致。

说明

在媒体处理 API 中,Object 必须经过 URL Encoding(基于 UTF-8 编码)后使用。

示例:

{"Bucket":"exampleBucket","Location":"oss-cn-hangzhou","Object":"example.flv","Referer": "用户自行在OSS控制台设置的OSS防盗链参数"}

OutputBucket

String

输出文件所在的 OSS Bucket。

  • 遵守 OSS Bucket 定义,更多信息请参见基本概念

Outputs

List

作业输出配置。

详细说明,请参见 参数详情

  • Outputs 由 Output 列表构成,JSON 数组,大小上限为 30。

示例:

[{"OutputObject":"exampleOutput.mp4","TemplateId":"6181666213ab41b9bc21da8ff5ff****","WaterMarks":[{"InputFile":{"Bucket":"exampleBucket","Location":"oss-cn-hangzhou","Object":"image_01.png"},"WaterMarkTemplateId":"9b772ce2740d4d55876d8b542d47****"}],"UserData":"testid-001"}]

PipelineId

String

管道 ID。

更多信息,请参见基本概念

OutputLocation

String

输出文件所在的 OSS Bucket 的地域(OSS Region)。

  • OSS Bucket 必须与媒体处理服务在同一个地域。

  • 遵守 OSS Bucket 定义,更多信息请参见基本概念

返回值

Fn::GetAtt

JobIds:任务 ID 列表。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  OutputBucket:
    Type: String
    Description:
      en: The name of the OSS bucket where the output files are stored.
    Required: true
  Input:
    Type: Json
    Description:
      en: The input configuration of the job. For more information, see Input details.
    Required: true
  Outputs:
    AssociationPropertyMetadata: {}
    AssociationProperty: List[Parameters]
    Type: Json
    Description:
      en: The output configuration of the job. Consists of a list of Output objects, JSON array, with a maximum size of 30.
    Required: true
  PipelineId:
    Type: String
    Description:
      en: The ID of the pipeline.
    Required: true
Resources:
  TranscodeJob:
    Type: ALIYUN::MPS::TranscodeJob
    Properties:
      OutputBucket:
        Ref: OutputBucket
      Input:
        Ref: Input
      Outputs:
        Ref: Outputs
      PipelineId:
        Ref: PipelineId
Outputs:
  JobIds:
    Description: The IDs of the jobs.
    Value:
      Fn::GetAtt:
        - TranscodeJob
        - JobIds
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "OutputBucket": {
      "Type": "String",
      "Description": {
        "en": "The name of the OSS bucket where the output files are stored."
      },
      "Required": true
    },
    "Input": {
      "Type": "Json",
      "Description": {
        "en": "The input configuration of the job. For more information, see Input details."
      },
      "Required": true
    },
    "Outputs": {
      "AssociationPropertyMetadata": {},
      "AssociationProperty": "List[Parameters]",
      "Type": "Json",
      "Description": {
        "en": "The output configuration of the job. Consists of a list of Output objects, JSON array, with a maximum size of 30."
      },
      "Required": true
    },
    "PipelineId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the pipeline."
      },
      "Required": true
    }
  },
  "Resources": {
    "TranscodeJob": {
      "Type": "ALIYUN::MPS::TranscodeJob",
      "Properties": {
        "OutputBucket": {
          "Ref": "OutputBucket"
        },
        "Input": {
          "Ref": "Input"
        },
        "Outputs": {
          "Ref": "Outputs"
        },
        "PipelineId": {
          "Ref": "PipelineId"
        }
      }
    }
  },
  "Outputs": {
    "JobIds": {
      "Description": "The IDs of the jobs.",
      "Value": {
        "Fn::GetAtt": [
          "TranscodeJob",
          "JobIds"
        ]
      }
    }
  }
}