创建工作流

最近更新时间:2024-11-12 17:57:53

我的收藏

功能描述

创建工作流。



授权说明

授权策略中 action 设置为 ci:CreateMediaWorkflow 。查看所有 action

服务开通

使用该功能需提前开通数据万象,并绑定存储桶。详情请参见 绑定存储桶

使用限制

使用该接口时,请先确认相关限制条件。详情请参见 使用限制

请求

请求示例

POST /workflow HTTP/1.1
Host: <BucketName-APPID>.ci.<Region>.myqcloud.com
Date: <GMT Date>
Authorization: <Auth String>
Content-Length: <length>
Content-Type: application/xml

<body>
说明:
Authorization: Auth String(详情请参见 请求签名 文档)。
通过子账号使用时,需要授予相关的权限,详情请参见 授权粒度详情 文档。

请求头

此接口仅使用公共请求头部,详情请参见 公共请求头部 文档。

请求体

该请求操作的实现需要有如下请求体:
请求体1
请求体2
对于输入的视频文件进行截图和转码处理。视频转码后, 同时进行转封装处理和生成智能封面, 然后对生成的封面进行图片处理。
<Request>
<MediaWorkflow>
<Name>workflow-1</Name>
<State>Active</State>
<Topology>
<Dependencies>
<Start>Snapshot_1581665960536,Transcode_1581665960538</Start>
<Snapshot_1581665960536>End</Snapshot_1581665960536>
<Transcode_1581665960538>Segment_15816659605667,SmartCover_1581665960539</Transcode_1581665960538>
<Segment_15816659605667>End</Segment_15816659605667>
<SmartCover_1581665960539>PicProcess_15816659605668</SmartCover_1581665960539>
<PicProcess_15816659605668>End</PicProcess_15816659605668>
</Dependencies>
<Nodes>
<Start>
<Type>Start</Type>
<Input>
<QueueId>p09d709939fef48a0a5c247ef39d90cec</QueueId>
<PicProcessQueueId>p2911917386e148639319e13c285cc774</PicProcessQueueId>
<ObjectPrefix>input/workflow-1</ObjectPrefix>
<NotifyConfig>
<State>On</State>
<Url>http://www.callback.com</Url>
<Event>TaskFinish,WorkflowFinish</Event>
<Type>Url</Type>
<ResultFormat>JSON</ResultFormat>
</NotifyConfig>
<ExtFilter>
<State>On</State>
<Video>true</Video>
<Audio>false</Audio>
<Image>false</Image>
<Custom>false</Custom>
<AllFile>false</AllFile>
</ExtFilter>
</Input>
</Start>
<Snapshot_1581665960536>
<Type>Snapshot</Type>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>abc/${RunId}/snapshot-${number}.${Ext}</Object>
<SpriteObject>abc/${RunId}/sprite-${number}.${Ext}</SpriteObject>
</Output>
</Operation>
</Snapshot_1581665960536>
<Transcode_1581665960538>
<Type>Transcode</Type>
<Operation>
<TemplateId>t16e81a29fe48c4e23acefc247a7792b63</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>bcd/${RunId}/trans.{Ext}</Object>
</Output>
</Operation>
</Transcode_1581665960538>
<Segment_15816659605667>
<Type>Segment</Type>
<Operation>
<Segment>
<Format>mkv</Format>
<Duration>20</Duration>
</Segment>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>test-trans${Number}.{Ext}</Object>
</Output>
</Operation>
</Segment_15816659605667>
<SmartCover_1581665960539>
<Type>SmartCover</Type>
<Operation>
<TemplateId>t16e81a29fe48c4e23acefc247a7792b63</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>abc/${RunId}/cover-${Number}.{Ext}</Object>
</Output>
</Operation>
</SmartCover_1581665960539>
<PicProcess_15816659605668>
<Type>PicProcess</Type>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>bcd/${RunId}/pic.{Ext}</Object>
</Output>
</Operation>
</PicProcess_15816659605668>
</Nodes>
</Topology>
</MediaWorkflow>
</Request>
自适应码流
<Request>
<MediaWorkflow>
<Name>workflow-2</Name>
<State>Active</State>
<Topology>
<Dependencies>
<Start>StreamPackConfig_1581665960532</Start>
<StreamPackConfig_1581665960532>VideoStream_1581665960536,VideoStream_1581665960537</StreamPackConfig_1581665960532>
<VideoStream_1581665960536>StreamPack_1581665960538</VideoStream_1581665960536>
<VideoStream_1581665960537>StreamPack_1581665960538</VideoStream_1581665960537>
<StreamPack_1581665960538>End</StreamPack_1581665960538>
</Dependencies>
<Nodes>
<Start>
<Type>Start</Type>
<Input>
<QueueId>p09d709939fef48a0a5c247ef39d90cec</QueueId>
<ObjectPrefix>input/workflow-2</ObjectPrefix>
<NotifyConfig>
<State>On</State>
<Url>http://www.callback.com</Url>
<Event>TaskFinish,WorkflowFinish</Event>
<Type>Url</Type>
<ResultFormat>JSON</ResultFormat>
</NotifyConfig>
<ExtFilter>
<State>On</State>
<Video>true</Video>
<Audio>false</Audio>
<Image>false</Image>
<Custom>false</Custom>
<AllFile>false</AllFile>
</ExtFilter>
</Input>
</Start>
<StreamPackConfig_1581665960532>
<Type>StreamPackConfig</Type>
<Operation>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>${InputPath}/${InputName}._${RunId}.${ext}</Object>
</Output>
<StreamPackConfig>
<PackType>HLS</PackType>
<IgnoreFailedStream>true</IgnoreFailedStream>
</StreamPackConfig>
</Operation>
</StreamPackConfig_1581665960532>
<VideoStream_1581665960536>
<Type>VideoStream</Type>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>${RunId}_Substream_1/video.m3u8</Object>
</Output>
</Operation>
</VideoStream_1581665960536>
<VideoStream_1581665960537>
<Type>VideoStream</Type>
<Operation>
<TemplateId>t1460606bgfdg2148c4ab182f55163ba7bj</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>${RunId}_Substream_2/video.m3u8</Object>
</Output>
</Operation>
</VideoStream_1581665960537>
<StreamPack_1581665960538>
<Type>StreamPack</Type>
<Operation>
<StreamPackInfo>
<VideoStreamConfig>
<VideoStreamName>VideoStream_1581665960536</VideoStreamName>
<BandWidth>200000000</BandWidth>
</VideoStreamConfig>
<VideoStreamConfig>
<VideoStreamName>VideoStream_1581665960537</VideoStreamName>
<BandWidth>200000000</BandWidth>
</VideoStreamConfig>
</StreamPackInfo>
</Operation>
</StreamPack_1581665960538>
</Nodes>
</Topology>
</MediaWorkflow>
</Request>
具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
Request
保存请求的容器
Container
Container 类型 Request 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
MediaWorkflow
Request
工作流节点
Container
Container 类型 MediaWorkflow 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Name
Request.MediaWorkflow
工作流名称
String
支持中文、英文、数字、—和_,长度限制128字符
State
Request.MediaWorkflow
工作流状态
String
Paused/Active
Topology
Request.MediaWorkflow
拓扑信息
Container
Container 类型 Topology 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Dependencies
Request.MediaWorkflow.Topology
节点依赖关系
Container
Nodes
Request.MediaWorkflow.Topology
节点列表
Container
Container 类型 Nodes 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Start
Request.MediaWorkflow.Topology.Nodes
开始节点
Container
只有唯一一个开始节点
Animation_***
Request.MediaWorkflow.Topology.Nodes
动图类型节点
Container
节点名称以 Animation 为前缀,可能有多个动图节点
Snapshot_***
Request.MediaWorkflow.Topology.Nodes
截图类型节点
Container
节点名称以 Snapshot 为前缀,可能有多个截图节点
SmartCover_***
Request.MediaWorkflow.Topology.Nodes
智能封面节点
Container
节点名称以 SmartCover 为前缀,可能有多个智能封面节点
Transcode_***
Request.MediaWorkflow.Topology.Nodes
转码节点
Container
节点名称以 Transcode 为前缀,可能有多个转码节点
Concat_***
Request.MediaWorkflow.Topology.Nodes
音视频拼接节点
Container
节点名称以 Concat 为前缀,可能有多个音视频拼接节点
VoiceSeparate_***
Request.MediaWorkflow.Topology.Nodes
人声节点
Container
节点名称以 VoiceSeparate 为前缀,可能有多个人声分离节点
VideoMontage_***
Request.MediaWorkflow.Topology.Nodes
精彩集锦节点
Container
节点名称以 VideoMontage 为前缀,可能有多个精彩集锦节点
StreamPackConfig_***
Request.MediaWorkflow.Topology.Nodes
自适应码流节点
Container
节点名称以 StreamPackConfig 为前缀,只能有一个 自适应码流节点。只能在 start 节点之后,后面只能是视频子流节点,可以有多个视频子流节点
VideoStream_***
Request.MediaWorkflow.Topology.Nodes
视频子流节点
Container
节点名称以 VideoStream 为前缀,可能有多个视频子流节点 ,只能在 StreamPackConfig 节点之后,后面只能是 StreamPack 节点
StreamPack_***
Request.MediaWorkflow.Topology.Nodes
自适应码流打包节点
Container
节点名称以 StreamPack 为前缀,只能有一个自适应码流打包节点 ,只能在视频子流节点之后,后面只能是 End 节点
SDRtoHDR_***
Request.MediaWorkflow.Topology.Nodes
SDRtoHDR 节点
Container
节点名称以 SDRtoHDR 为前缀,可能有多个 SDRtoHDR 节点
VideoProcess_***
Request.MediaWorkflow.Topology.Nodes
视频处理节点
Container
节点名称以 VideoProcess 为前缀,可能有多个视频处理节点
SCF_***
Request.MediaWorkflow.Topology.Nodes
SCF 函数节点
Container
节点名称以 SCF 为前缀,可能有多个 SCF 函数节点
SuperResolution_***
Request.MediaWorkflow.Topology.Nodes
超分辨率节点
Container
节点名称以 SuperResolution 为前缀,可能有多个超分辨率节点
Segment_***
Request.MediaWorkflow.Topology.Nodes
音视频转封装节点
Container
节点名称以 Segment 为前缀,可能有多个音视频转封装节点
PicProcess_***
Request.MediaWorkflow.Topology.Nodes
图片处理节点
Container
节点名称以 PicProcess 为前缀,可能有多个图片处理节点
Tts_***
Request.MediaWorkflow.Topology.Nodes
语音合成节点
Container
节点名称以 Tts 为前缀,可能有多个语音合成节点
SpeechRecognition_***
Request.MediaWorkflow.Topology.Nodes
语音识别节点
Container
节点名称以 SpeechRecognition 为前缀,可能有多个语音识别节点
VideoEnhance_***
Request.MediaWorkflow.Topology.Nodes
画质增强节点
Container
节点名称以 VideoEnhance 为前缀,可能有多个语音识别节点
Condition_***
Request.MediaWorkflow.Topology.Nodes
条件判断节点
Container
节点名称以 Condition 为前缀,可能有多个条件判断节点
MediaInfo_***
Request.MediaWorkflow.Topology.Nodes
媒体信息获取节点
Container
节点名称以 MediaInfo 为前缀,可能有多个媒体信息获取节点
AIRecognition_***
Request.MediaWorkflow.Topology.Nodes
AI识别节点
Container
节点名称以 AIRecognition 为前缀
SegmentVideoBody_***
Request.MediaWorkflow.Topology.Nodes
视频人像抠图
Container
节点名称以 SegmentVideoBody 为前缀

Container 类型 Start 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.opology.Nodes.Start
节点类型
String
Start
Input
Request.MediaWorkflow.Topology.Nodes.Start
输入信息, 详情见 Input
Container
Container 类型 Animation_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.Animation_***
节点类型
String
Animation
Operation
Request.MediaWorkflow.Topology.Nodes.Animation_***
操作规则, 详情见 Animation
Container
Container 类型 Snapshot_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.Snapshot_***
节点类型
String
Snapshot
Operation
Request.MediaWorkflow.Topology.Nodes.Snapshot_***
操作规则, 详情见 Snapshot
Container
Container 类型 SmartCover_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.SmartCover_***
节点类型
String
SmartCover
Operation
Request.MediaWorkflow.Topology.Nodes.SmartCover_***
操作规则, 详情见 SmartCover
Container
Container 类型 Transcode_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.Transcode_***
节点类型
String
Transcode
Operation
Request.MediaWorkflow.Topology.Nodes.Transcode_***
操作规则, 详情见 Transcode
Container
Container 类型 Concat_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.Concat_***
节点类型
String
Concat
Operation
Request.MediaWorkflow.Topology.Nodes.Concat_***
操作规则, 详情见 Concat
Container
Container 类型 VoiceSeparate_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.VoiceSeparate_***
节点类型
String
VoiceSeparate
Operation
Request.MediaWorkflow.Topology.Nodes.VoiceSeparate_***
操作规则, 详情见 VoiceSeparate
Container
Container 类型 VideoMontage_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.VideoMontage_***
节点类型
String
VideoMontage
Operation
Request.MediaWorkflow.Topology.Nodes.VideoMontage_***
操作规则, 详情见 VideoMontage
Container
Container 类型 StreamPackConfig_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.StreamPackConfig_***
节点类型
String
StreamPackConfig
Operation
Request.MediaWorkflow.Topology.Nodes.StreamPackConfig_***
操作规则, 详情见 StreamPackConfig
Container
Container 类型 VideoStream_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.VideoStream_***
节点类型
String
VideoStream
Operation
Request.MediaWorkflow.Topology.Nodes.VideoStream_***
操作规则, 详情见 VideoStream
Container
Container 类型 StreamPack_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.StreamPack_***
节点类型
String
StreamPack
Operation
Request.MediaWorkflow.Topology.Nodes.StreamPack_***
操作规则, 详情见 StreamPack
Container
Container 类型 SDRtoHDR_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.SDRtoHDR_***
节点类型
String
SDRtoHDR
Operation
Request.MediaWorkflow.Topology.Nodes.SDRtoHDR_***
操作规则, 详情见 SDRtoHDR
Container
Container 类型 VideoProcess_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.VideoProcess_***
节点类型
String
VideoProcess
Operation
Request.MediaWorkflow.Topology.Nodes.VideoProcess_***
操作规则, 详情见 VideoProcess
Container
Container 类型 SCF_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.SCF_***
节点类型
String
SCF
Operation
Request.MediaWorkflow.Topology.Nodes.SCF_***
操作规则, 详情见 SCF
Container
Container 类型 SuperResolution_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.SuperResolution_***
节点类型
String
SuperResolution
Operation
Request.MediaWorkflow.Topology.Nodes.SuperResolution_***
操作规则, 详情见 SuperResolution
Container
Container 类型 Segment_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.Segment_***
节点类型
String
Segment
Operation
Request.MediaWorkflow.Topology.Nodes.Segment_***
操作规则, 详情见 Segment
Container
Container 类型 PicProcess_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.PicProcess_***
节点类型
String
PicProcess
Operation
Request.MediaWorkflow.Topology.Nodes.PicProcess_***
操作规则, 详情见 PicProcess
Container
Container 类型 Tts_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.Tts_***
节点类型
String
Tts
Operation
Request.MediaWorkflow.Topology.Nodes.Tts_***
操作规则, 详情见 Tts
Container
Container 类型 SpeechRecognition_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.SpeechRecognition_***
节点类型
String
SpeechRecognition
Operation
Request.MediaWorkflow.Topology.Nodes.SpeechRecognition_***
操作规则, 详情见 SpeechRecognition
Container
Container 类型 VideoEnhance_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.VideoEnhance_***
节点类型
String
VideoEnhance
Operation
Request.MediaWorkflow.Topology.Nodes.VideoEnhance_***
操作规则, 详情见 VideoEnhance
Container
Container 类型 Condition_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.Condition_***
节点类型
String
Condition
Operation
Request.MediaWorkflow.Topology.Nodes.Condition_***
操作规则, 详情见 Condition
Container
Container 类型 MediaInfo_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.MediaInfo_***
节点类型
String
MediaInfo
Container 类型 AIRecognition_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.AIRecognition_***
节点类型
String
AIRecognition
Container 类型 SegmentVideoBody_*** 的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Type
Request.MediaWorkflow.Topology.Nodes.SegmentVideoBody_***
节点类型
String
SegmentVideoBody
Operation
Request.MediaWorkflow.Topology.Nodes.SegmentVideoBody_***
操作规则, 详情见 VideoEnhance
Container
工作流节点依赖关系如下:
工作流节点类型
后面可连接的节点类型
Start
Snapshot,Animation,SmartCover,Transcode,Concat,VoiceSeparate,VideoMontage,StreamPackConfig,SDRtoHDR,VideoProcess,SCF,SuperResolution,Segment,PicProcess,Tts,SpeechRecognition,VideoEnhance,MediaInfo,AIRecognition,VideoEnhance,SegmentVideoBody
Snapshot
PicProcess,SCF,End
Animation
SCF,End
SmartCover
PicProcess,SCF,End
Transcode
Snapshot,Animation,SmartCover,Concat,VideoMontage,SDRtoHDR,VideoProcess,SCF,Segment,SpeechRecognition,VideoEnhance,MediaInfo,SegmentVideoBody,End
Concat
Transcode,Snapshot,Animation,SmartCover,SDRtoHDR,VideoProcess,SCF,Segment,VideoEnhance,MediaInfo,VideoEnhance,SegmentVideoBody,End
VoiceSeparate
SCF,SpeechRecognition,End
VideoMontage
Snapshot,Animation,SDRtoHDR,VideoProcess,SCF,SuperResolution,VideoEnhance,Segment,MediaInfo,VideoEnhance,SegmentVideoBody,End
StreamPackConfig
VideoStream
VideoStream
StreamPack
StreamPack
End
SDRtoHDR
Transcode,Concat,VideoMontage,VoiceSeparate,SmartCover,Animation,VideoProcess,SCF,SuperResolution,SegmentVideoBody,End
VideoProcess
Transcode,Concat,VideoMontage,VoiceSeparate,SmartCover,Animation,SDRtoHDR,SCF,Segment,SuperResolution,MediaInfo,SegmentVideoBody,End
SCF
SDRtoHDR,Snapshot,Transcode,Concat,VideoMontage,VoiceSeparate,SmartCover,Animation,VideoProcess,End
SuperResolution
VideoMontage,Transcode,SmartCover,Animation,Snapshot,SCF,Segment,SDRtoHDR,VideoProcess,MediaInfo,SegmentVideoBody,End
Segment
VideoEnhance,SegmentVideoBody, End
PicProcess
SCF,End
Tts
SCF,Transcode,End
SpeechRecognition
SCF,Tts,End
VideoEnhance
Transcode,VideoMontage,SmartCover,Animation,Snapshot,SCF,Segment,SpeechRecognition,Segment,VoiceSeparate,MediaInfo, End
MediaInfo
Condition,End
Condition
Transcode,HighSpeedHd,SuperResolution,VideoProcess,Animation,Snapshot,VideoMontage,SmartCover,Concat,VideoEnhance
AIRecognition
End
SegmentVideoBody
End
工作流支持的通配符:
通配符
含义
${InputPath}
输入文件的路径(不包括文件名)
${InputName}
输入文件的文件名(不包括后缀)
${InputNameAndExt}
输入文件的文件名(包括后缀)
${RunId}
实例 Id
${Ext}
封装格式后缀
${Jobid}
任务Id
${Number}
产物索引, 从0开始计数, 仅支持 Snapshot、SmartCover、Segment 节点
${Time}
截图时间点(单位:毫秒), 仅支持 Snapshot 节点

响应

响应头

此接口仅返回公共响应头部,详情请参见 公共响应头部 文档。

响应体

该响应体返回为 application/xml 数据,包含完整节点数据的内容展示如下:
响应体1
响应体2
对于输入的视频文件进行截图和转码处理。视频转码后, 同时进行转封装处理和生成智能封面, 然后对生成的封面进行图片处理
<Response>
<RequestId>NjJmMWQxYjNfOTBmYTUwNjRfNWYyY18x</RequestId>
<MediaWorkflow>
<Name>workflow-1</Name>
<State>Active</State>
<WorkflowId>wc666d0b9f9dd47ae9137a096252d49f7</WorkflowId>
<BucketId>test-1234567890</BucketId>
<CreateTime>2022-07-14T12:37:28+0800</CreateTime>
<UpdateTime>2022-07-14T12:37:28+0800</UpdateTime>
<Topology>
<Dependencies>
<Start>Snapshot_1581665960536,Transcode_1581665960538</Start>
<Snapshot_1581665960536>End</Snapshot_1581665960536>
<Transcode_1581665960538>Segment_15816659605667,SmartCover_1581665960539</Transcode_1581665960538>
<Segment_15816659605667>End</Segment_15816659605667>
<SmartCover_1581665960539>PicProcess_15816659605668</SmartCover_1581665960539>
<PicProcess_15816659605668>End</PicProcess_15816659605668>
</Dependencies>
<Nodes>
<Start>
<Type>Start</Type>
<Input>
<QueueId>p09d709939fef48a0a5c247ef39d90cec</QueueId>
<PicProcessQueueId>p2911917386e148639319e13c285cc774</PicProcessQueueId>
<ObjectPrefix>input/workflow-1</ObjectPrefix>
<NotifyConfig>
<State>On</State>
<Url>http://www.callback.com</Url>
<Event>TaskFinish,WorkflowFinish</Event>
<Type>Url</Type>
<ResultFormat>JSON</ResultFormat>
</NotifyConfig>
<ExtFilter>
<State>On</State>
<Video>true</Video>
<Audio>false</Audio>
<Image>false</Image>
<Custom>false</Custom>
<AllFile>false</AllFile>
</ExtFilter>
</Input>
</Start>
<Snapshot_1581665960536>
<Type>Snapshot</Type>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>abc/${RunId}/snapshot-${number}.${Ext}</Object>
<SpriteObject>abc/${RunId}/sprite-${number}.${Ext}</SpriteObject>
</Output>
</Operation>
</Snapshot_1581665960536>
<Transcode_1581665960538>
<Type>Transcode</Type>
<Operation>
<TemplateId>t16e81a29fe48c4e23acefc247a7792b63</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>bcd/${RunId}/trans.{Ext}</Object>
</Output>
</Operation>
</Transcode_1581665960538>
<Segment_15816659605667>
<Type>Segment</Type>
<Operation>
<Segment>
<Format>mkv</Format>
<Duration>20</Duration>
</Segment>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>test-trans${Number}.{Ext}</Object>
</Output>
</Operation>
</Segment_15816659605667>
<SmartCover_1581665960539>
<Type>SmartCover</Type>
<Operation>
<TemplateId>t16e81a29fe48c4e23acefc247a7792b63</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>abc/${RunId}/cover-${Number}.{Ext}</Object>
</Output>
</Operation>
</SmartCover_1581665960539>
<PicProcess_15816659605668>
<Type>PicProcess</Type>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>bcd/${RunId}/pic.{Ext}</Object>
</Output>
</Operation>
</PicProcess_15816659605668>
</Nodes>
</Topology>
</MediaWorkflow>
</Response>
自适应码流
<Response>
<MediaWorkflow>
<Name>workflow-2</Name>
<State>Active</State>
<WorkflowId>w93aa43ba105347169fa093ed857b2a90</WorkflowId>
<BucketId>test-1234567890</BucketId>
<CreateTime>2022-07-14T12:37:28+0800</CreateTime>
<UpdateTime>2022-07-14T12:37:28+0800</UpdateTime>
<Topology>
<Dependencies>
<Start>StreamPackConfig_1581665960532</Start>
<StreamPackConfig_1581665960532>VideoStream_1581665960536,VideoStream_1581665960537</StreamPackConfig_1581665960532>
<VideoStream_1581665960536>StreamPack_1581665960538</VideoStream_1581665960536>
<VideoStream_1581665960537>StreamPack_1581665960538</VideoStream_1581665960537>
<StreamPack_1581665960538>End</StreamPack_1581665960538>
</Dependencies>
<Nodes>
<Start>
<Type>Start</Type>
<Input>
<QueueId>p09d709939fef48a0a5c247ef39d90cec</QueueId>
<ObjectPrefix>input/workflow-2</ObjectPrefix>
<NotifyConfig>
<State>On</State>
<Url>http://www.callback.com</Url>
<Event>TaskFinish,WorkflowFinish</Event>
<Type>Url</Type>
<ResultFormat>JSON</ResultFormat>
</NotifyConfig>
<ExtFilter>
<State>On</State>
<Video>true</Video>
<Audio>false</Audio>
<Image>false</Image>
<Custom>false</Custom>
<AllFile>false</AllFile>
</ExtFilter>
</Input>
</Start>
<StreamPackConfig_1581665960532>
<Type>StreamPackConfig</Type>
<Operation>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>${InputPath}/${InputName}._${RunId}.${ext}</Object>
</Output>
<StreamPackConfig>
<PackType>HLS</PackType>
<IgnoreFailedStream>true</IgnoreFailedStream>
</StreamPackConfig>
</Operation>
</StreamPackConfig_1581665960532>
<VideoStream_1581665960536>
<Type>VideoStream</Type>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>${RunId}_Substream_1/video.m3u8</Object>
</Output>
</Operation>
</VideoStream_1581665960536>
<VideoStream_1581665960537>
<Type>VideoStream</Type>
<Operation>
<TemplateId>t1460606bgfdg2148c4ab182f55163ba7bj</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>${RunId}_Substream_2/video.m3u8</Object>
</Output>
</Operation>
</VideoStream_1581665960537>
<StreamPack_1581665960538>
<Type>StreamPack</Type>
<Operation>
<StreamPackInfo>
<VideoStreamConfig>
<VideoStreamName>VideoStream_1581665960536</VideoStreamName>
<BandWidth>200000000</BandWidth>
</VideoStreamConfig>
<VideoStreamConfig>
<VideoStreamName>VideoStream_1581665960537</VideoStreamName>
<BandWidth>200000000</BandWidth>
</VideoStreamConfig>
</StreamPackInfo>
</Operation>
</StreamPack_1581665960538>
</Nodes>
</Topology>
</MediaWorkflow>
</Response>
具体的数据内容如下:
节点名称(关键字)
父节点
描述
类型
Response
保存结果的容器
Container
Container 节点 Response 的内容:
节点名称(关键字)
父节点
描述
类型
RequestId
Response
请求的唯一 ID
String
MediaWorkflow
Response
工作流数组
Container
Container节点 MediaWorkflow 的内容:
节点名称(关键字)
父节点
描述
类型
Name
Response.MediaWorkflow
工作流名称
String
WorkflowId
Response.MediaWorkflow
工作流 ID
String
State
Response.MediaWorkflow
工作流状态
String
CreateTime
Response.MediaWorkflow
创建时间
String
UpdateTime
Response.MediaWorkflow
更新时间
String
Topology
Response.MediaWorkflow
拓扑信息,同请求中的 Request.MediaWorkflow.Topology
Container

错误码

该请求操作无特殊错误信息,常见的错误信息请参见 错误码 文档。

实际案例

请求1
响应1
请求2
响应2
对于输入的视频文件进行截图和转码处理。视频转码后,同时进行转封装处理和生成智能封面,然后对生成的封面进行图片处理。

POST /workflow HTTP/1.1 Authorization: q-sign-algorithm=sha1&q-ak=******************************************&q-sign-time=1497530202;1497610202&q-key-time=1497530202;1497610202&q-header-list=&q-url-param-list=&q-signature=************************************************* Content-Length: 166 Content-Type: application/xml

<Request>
<MediaWorkflow>
<Name>workflow-1</Name>
<State>Active</State>
<Topology>
<Dependencies>
<Start>Snapshot_1581665960536,Transcode_1581665960538</Start>
<Snapshot_1581665960536>End</Snapshot_1581665960536>
<Transcode_1581665960538>Segment_15816659605667,SmartCover_1581665960539</Transcode_1581665960538>
<Segment_15816659605667>End</Segment_15816659605667>
<SmartCover_1581665960539>PicProcess_15816659605668</SmartCover_1581665960539>
<PicProcess_15816659605668>End</PicProcess_15816659605668>
</Dependencies>
<Nodes>
<Start>
<Type>Start</Type>
<Input>
<QueueId>p09d709939fef48a0a5c247ef39d90cec</QueueId>
<PicProcessQueueId>p2911917386e148639319e13c285cc774</PicProcessQueueId>
<ObjectPrefix>input/workflow-1</ObjectPrefix>
<NotifyConfig>
<State>On</State>
<Url>http://www.callback.com</Url>
<Event>TaskFinish,WorkflowFinish</Event>
<Type>Url</Type>
<ResultFormat>JSON</ResultFormat>
</NotifyConfig>
<ExtFilter>
<State>On</State>
<Video>true</Video>
<Audio>false</Audio>
<Image>false</Image>
<Custom>false</Custom>
<AllFile>false</AllFile>
</ExtFilter>
</Input>
</Start>
<Snapshot_1581665960536>
<Type>Snapshot</Type>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>abc/${RunId}/snapshot-${number}.${Ext}</Object>
<SpriteObject>abc/${RunId}/sprite-${number}.${Ext}</SpriteObject>
</Output>
</Operation>
</Snapshot_1581665960536>
<Transcode_1581665960538>
<Type>Transcode</Type>
<Operation>
<TemplateId>t16e81a29fe48c4e23acefc247a7792b63</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>bcd/${RunId}/trans.{Ext}</Object>
</Output>
</Operation>
</Transcode_1581665960538>
<Segment_15816659605667>
<Type>Segment</Type>
<Operation>
<Segment>
<Format>mkv</Format>
<Duration>20</Duration>
</Segment>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>test-trans${Number}.{Ext}</Object>
</Output>
</Operation>
</Segment_15816659605667>
<SmartCover_1581665960539>
<Type>SmartCover</Type>
<Operation>
<TemplateId>t16e81a29fe48c4e23acefc247a7792b63</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>abc/${RunId}/cover-${Number}.{Ext}</Object>
</Output>
</Operation>
</SmartCover_1581665960539>
<PicProcess_15816659605668>
<Type>PicProcess</Type>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>bcd/${RunId}/pic.{Ext}</Object>
</Output>
</Operation>
</PicProcess_15816659605668>
</Nodes>
</Topology>
</MediaWorkflow>
</Request>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 230
Connection: keep-alive
Date: Thu, 14 Jul 2022 12:37:29 GMT
Server: tencent-ci
x-ci-request-id: NjJ************************

<Response>
<RequestId>NjJmMWQxYjNfOTBmYTUwNjRfNWYyY18x</RequestId>
<MediaWorkflow>
<Name>workflow-1</Name>
<State>Active</State>
<WorkflowId>wc666d0b9f9dd47ae9137a096252d49f7</WorkflowId>
<BucketId>test-1234567890</BucketId>
<CreateTime>2022-07-14T12:37:28+0800</CreateTime>
<UpdateTime>2022-07-14T12:37:28+0800</UpdateTime>
<Topology>
<Dependencies>
<Start>Snapshot_1581665960536,Transcode_1581665960538</Start>
<Snapshot_1581665960536>End</Snapshot_1581665960536>
<Transcode_1581665960538>Segment_15816659605667,SmartCover_1581665960539</Transcode_1581665960538>
<Segment_15816659605667>End</Segment_15816659605667>
<SmartCover_1581665960539>PicProcess_15816659605668</SmartCover_1581665960539>
<PicProcess_15816659605668>End</PicProcess_15816659605668>
</Dependencies>
<Nodes>
<Start>
<Type>Start</Type>
<Input>
<QueueId>p09d709939fef48a0a5c247ef39d90cec</QueueId>
<PicProcessQueueId>p2911917386e148639319e13c285cc774</PicProcessQueueId>
<ObjectPrefix>input/workflow-1</ObjectPrefix>
<NotifyConfig>
<State>On</State>
<Url>http://www.callback.com</Url>
<Event>TaskFinish,WorkflowFinish</Event>
<Type>Url</Type>
<ResultFormat>JSON</ResultFormat>
</NotifyConfig>
<ExtFilter>
<State>On</State>
<Video>true</Video>
<Audio>false</Audio>
<Image>false</Image>
<Custom>false</Custom>
<AllFile>false</AllFile>
</ExtFilter>
</Input>
</Start>
<Snapshot_1581665960536>
<Type>Snapshot</Type>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>abc/${RunId}/snapshot-${number}.${Ext}</Object>
<SpriteObject>abc/${RunId}/sprite-${number}.${Ext}</SpriteObject>
</Output>
</Operation>
</Snapshot_1581665960536>
<Transcode_1581665960538>
<Type>Transcode</Type>
<Operation>
<TemplateId>t16e81a29fe48c4e23acefc247a7792b63</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>bcd/${RunId}/trans.{Ext}</Object>
</Output>
</Operation>
</Transcode_1581665960538>
<Segment_15816659605667>
<Type>Segment</Type>
<Operation>
<Segment>
<Format>mkv</Format>
<Duration>20</Duration>
</Segment>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>test-trans${Number}.{Ext}</Object>
</Output>
</Operation>
</Segment_15816659605667>
<SmartCover_1581665960539>
<Type>SmartCover</Type>
<Operation>
<TemplateId>t16e81a29fe48c4e23acefc247a7792b63</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>abc/${RunId}/cover-${Number}.{Ext}</Object>
</Output>
</Operation>
</SmartCover_1581665960539>
<PicProcess_15816659605668>
<Type>PicProcess</Type>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>bcd/${RunId}/pic.{Ext}</Object>
</Output>
</Operation>
</PicProcess_15816659605668>
</Nodes>
</Topology>
</MediaWorkflow>
</Response>
自适应码流

POST /workflow HTTP/1.1 Authorization: q-sign-algorithm=sha1&q-ak=******************************************&q-sign-time=1497530202;1497610202&q-key-time=1497530202;1497610202&q-header-list=&q-url-param-list=&q-signature=************************************************* Host: test-1234567890.ci.ap-chongqing.myqcloud.com Content-Length: 166 Content-Type: application/xml

<Request>
<MediaWorkflow>
<Name>workflow-2</Name>
<State>Active</State>
<Topology>
<Dependencies>
<Start>StreamPackConfig_1581665960532</Start>
<StreamPackConfig_1581665960532>VideoStream_1581665960536,VideoStream_1581665960537</StreamPackConfig_1581665960532>
<VideoStream_1581665960536>StreamPack_1581665960538</VideoStream_1581665960536>
<VideoStream_1581665960537>StreamPack_1581665960538</VideoStream_1581665960537>
<StreamPack_1581665960538>End</StreamPack_1581665960538>
</Dependencies>
<Nodes>
<Start>
<Type>Start</Type>
<Input>
<QueueId>p09d709939fef48a0a5c247ef39d90cec</QueueId>
<ObjectPrefix>input/workflow-2</ObjectPrefix>
<NotifyConfig>
<State>On</State>
<Url>http://www.callback.com</Url>
<Event>TaskFinish,WorkflowFinish</Event>
<Type>Url</Type>
<ResultFormat>JSON</ResultFormat>
</NotifyConfig>
<ExtFilter>
<State>On</State>
<Video>true</Video>
<Audio>false</Audio>
<Image>false</Image>
<Custom>false</Custom>
<AllFile>false</AllFile>
</ExtFilter>
</Input>
</Start>
<StreamPackConfig_1581665960532>
<Type>StreamPackConfig</Type>
<Operation>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>${InputPath}/${InputName}._${RunId}.${ext}</Object>
</Output>
<StreamPackConfig>
<PackType>HLS</PackType>
<IgnoreFailedStream>true</IgnoreFailedStream>
</StreamPackConfig>
</Operation>
</StreamPackConfig_1581665960532>
<VideoStream_1581665960536>
<Type>VideoStream</Type>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>${RunId}_Substream_1/video.m3u8</Object>
</Output>
</Operation>
</VideoStream_1581665960536>
<VideoStream_1581665960537>
<Type>VideoStream</Type>
<Operation>
<TemplateId>t1460606bgfdg2148c4ab182f55163ba7bj</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>${RunId}_Substream_2/video.m3u8</Object>
</Output>
</Operation>
</VideoStream_1581665960537>
<StreamPack_1581665960538>
<Type>StreamPack</Type>
<Operation>
<StreamPackInfo>
<VideoStreamConfig>
<VideoStreamName>VideoStream_1581665960536</VideoStreamName>
<BandWidth>200000000</BandWidth>
</VideoStreamConfig>
<VideoStreamConfig>
<VideoStreamName>VideoStream_1581665960537</VideoStreamName>
<BandWidth>200000000</BandWidth>
</VideoStreamConfig>
</StreamPackInfo>
</Operation>
</StreamPack_1581665960538>
</Nodes>
</Topology>
</MediaWorkflow>
</Request>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 230
Connection: keep-alive
Date: Thu, 14 Jul 2022 12:37:29 GMT
Server: tencent-ci
x-ci-request-id: NTk************************

<Response>
<RequestId>NTk0MjdmODlfMjQ4OGY3XzYzYzhf95s=</RequestId>
<MediaWorkflow>
<Name>workflow-2</Name>
<State>Active</State>
<WorkflowId>w93aa43ba105347169fa093ed857b2a90</WorkflowId>
<BucketId>test-1234567890</BucketId>
<CreateTime>2022-07-14T12:37:28+0800</CreateTime>
<UpdateTime>2022-07-14T12:37:28+0800</UpdateTime>
<Topology>
<Dependencies>
<Start>StreamPackConfig_1581665960532</Start>
<StreamPackConfig_1581665960532>VideoStream_1581665960536,VideoStream_1581665960537</StreamPackConfig_1581665960532>
<VideoStream_1581665960536>StreamPack_1581665960538</VideoStream_1581665960536>
<VideoStream_1581665960537>StreamPack_1581665960538</VideoStream_1581665960537>
<StreamPack_1581665960538>End</StreamPack_1581665960538>
</Dependencies>
<Nodes>
<Start>
<Type>Start</Type>
<Input>
<QueueId>p09d709939fef48a0a5c247ef39d90cec</QueueId>
<ObjectPrefix>input/workflow-2</ObjectPrefix>
<NotifyConfig>
<State>On</State>
<Url>http://www.callback.com</Url>
<Event>TaskFinish,WorkflowFinish</Event>
<Type>Url</Type>
<ResultFormat>JSON</ResultFormat>
</NotifyConfig>
<ExtFilter>
<State>On</State>
<Video>true</Video>
<Audio>false</Audio>
<Image>false</Image>
<Custom>false</Custom>
<AllFile>false</AllFile>
</ExtFilter>
</Input>
</Start>
<StreamPackConfig_1581665960532>
<Type>StreamPackConfig</Type>
<Operation>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>${InputPath}/${InputName}._${RunId}.${ext}</Object>
</Output>
<StreamPackConfig>
<PackType>HLS</PackType>
<IgnoreFailedStream>true</IgnoreFailedStream>
</StreamPackConfig>
</Operation>
</StreamPackConfig_1581665960532>
<VideoStream_1581665960536>
<Type>VideoStream</Type>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>${RunId}_Substream_1/video.m3u8</Object>
</Output>
</Operation>
</VideoStream_1581665960536>
<VideoStream_1581665960537>
<Type>VideoStream</Type>
<Operation>
<TemplateId>t1460606bgfdg2148c4ab182f55163ba7bj</TemplateId>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>${RunId}_Substream_2/video.m3u8</Object>
</Output>
</Operation>
</VideoStream_1581665960537>
<StreamPack_1581665960538>
<Type>StreamPack</Type>
<Operation>
<StreamPackInfo>
<VideoStreamConfig>
<VideoStreamName>VideoStream_1581665960536</VideoStreamName>
<BandWidth>200000000</BandWidth>
</VideoStreamConfig>
<VideoStreamConfig>
<VideoStreamName>VideoStream_1581665960537</VideoStreamName>
<BandWidth>200000000</BandWidth>
</VideoStreamConfig>
</StreamPackInfo>
</Operation>
</StreamPack_1581665960538>
</Nodes>
</Topology>
</MediaWorkflow>
</Response>