功能描述
提交一个超分辨率任务。
请求
请求示例
POST /jobs HTTP/1.1Host: <BucketName-APPID>.ci.<Region>.myqcloud.comDate: <GMT Date>Authorization: <Auth String>Content-Length: <length>Content-Type: application/xml<body>
请求头
请求体
该请求操作的实现需要有如下请求体。
<Request><Tag>SuperResolution</Tag><Input><Object>input/demo.mp4</Object></Input><Operation><TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId><TranscodeTemplateId>t160606b9752148c4absdfaf2f55163b1f</TranscodeTemplateId><WatermarkTemplateId>t146d70eb241c44c63b6efc1cc93ccfc5d</WatermarkTemplateId><WatermarkTemplateId>t12a74d11687d444deba8a6cc52051ac27</WatermarkTemplateId><DigitalWatermark><Type>Text</Type><Message>123456789ab</Message><Version>V1</Version><IgnoreError>false</IgnoreError></DigitalWatermark><Output><Region>ap-chongqing</Region><Bucket>test-123456789</Bucket><Object>output/out.mp4</Object></Output><UserData>This is my data.</UserData><JobLevel>0</JobLevel></Operation><QueueId>p2242ab62c7c94486915508540933a2c6</QueueId><CallBack>http://callback.demo.com</CallBack><CallBackFormat>JSON<CallBackFormat></Request>
具体的数据描述如下:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 是否必选  | 
Request  | 无  | 保存请求的容器  | Container  | 是  | 
Container 类型 Request 的具体数据描述如下:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 是否必选  | 
Tag  | Request  | 创建任务的 Tag:SuperResolution  | String  | 是  | 
Input  | Request  | 待操作的媒体信息  | Container  | 是  | 
Operation  | Request  | 操作规则  | Container  | 是  | 
QueueId  | Request  | 任务所在的队列 ID  | String  | 是  | 
CallBackFormat  | Request  | 任务回调格式,JSON 或 XML,默认 XML,优先级高于队列的回调格式  | String  | 否  | 
CallBackType  | Request  | 任务回调类型,Url 或 TDMQ,默认 Url,优先级高于队列的回调类型  | String  | 否  | 
CallBack  | Request  | 任务回调地址,优先级高于队列的回调地址。设置为 no 时,表示队列的回调地址不产生回调  | String  | 否  | 
CallBackMqConfig  | Request  | 任务回调 TDMQ 配置,当 CallBackType 为 TDMQ 时必填。详情见 CallBackMqConfig  | Container  | 否  | 
Container 类型 Input 的具体数据描述如下:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 是否必选  | 
Object  | Request.Input  | 媒体文件名  | String  | 是  | 
Container 类型 Operation 的具体数据描述如下:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 是否必选  | 
SuperResolution  | Request.Operation  | 指定超分辨率模板参数,不能与 TemplateId 同时为空  | Container  | 否  | 
TemplateId  | Request.Operation  | 指定的超分辨率模 ID,优先使用模板 ID,不能与 SuperResolution 同时为空  | String  | 否  | 
Transcode  | Request.Operation  | 指定转码模板参数,不能与 TranscodeTemplateId 同时为空  | Container  | 否  | 
TranscodeTemplateId  | Request.Operation  | 指定的转码模板 ID,优先使用模板 ID,不能与 Transcode 同时为空  | String  | 否  | 
Watermark  | Request.Operation  | Container 数组  | 否  | |
WatermarkTemplateId  | Request.Operation  | 指定的水印模板 ID,可以传多个水印模板 ID,最多传3个,优先使用模板 ID  | String 数组  | 否  | 
DigitalWatermark  | Request.Operation  | 指定数字水印参数  | Container  | 否  | 
Output  | Request.Operation  | 结果输出地址  | Container  | 是  | 
UserData  | Request.Operation  | 透传用户信息, 可打印的 ASCII 码, 长度不超过1024  | String  | 否  | 
JobLevel  | Request.Operation  | 任务优先级,级别限制:0 、1 、2。级别越大任务优先级越高,默认为0  | String  | 否  | 
说明
 提交超分辨率任务必须传入转码参数。对于超分辨率参数,优先使用 TemplateId,无 TemplateId 时使用 SuperResolution;对于转码参数,优先使用 TranscodeTemplateId,无 TranscodeTemplateId 时使用 Transcode;对于水印参数,可以使用 WatermarkTemplateId 或 Watermark 设置,WatermarkTemplateId 优先级更高。
Container 类型 SuperResolution 的具体数据描述如下:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 是否必选  | 
Resolution  | Request.Operation.SuperResolution  | String  | 是  | |
EnableScaleUp  | Request.Operation.SuperResolution  | String  | 否  | |
Version  | Request.Operation.SuperResolution  | String  | 否  | 
Container 类型 Transcode 的具体数据描述如下:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 是否必选  | 
TimeInterval  | Request.Operation.Transcode  | Container  | 否  | |
Container  | Request.Operation.Transcode  | Container  | 否  | |
Video  | Request.Operation.Transcode  | Container  | 否  | |
Audio  | Request.Operation.Transcode  | Container  | 否  | |
TransConfig  | Request.Operation.Transcode  | Container  | 否  | |
AudioMix  | Request.Operation.Transcode  | Container 数组  | 否  | 
Container 类型 DigitalWatermark 的具体数据描述如下:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 必选  | 
Message  | Request.Operation.DigitalWatermark  | 数字水印嵌入的字符串信息,长度不超过64个字符,仅支持中文、英文、数字、_、-和*  | String  | 是  | 
Type  | Request.Operation.DigitalWatermark  | 水印类型,当前仅可设置为 Text  | String  | 是  | 
Version  | Request.Operation.DigitalWatermark  | 水印版本,当前仅可设置为 V1  | String  | 是  | 
IgnoreError  | Request.Operation.DigitalWatermark  | 当添加水印失败是否忽略错误继续执行任务,限制为 true/false,默认 false  | string  | 否  | 
Container 类型 Output 的具体数据描述如下:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 是否必选  | 
Region  | Request.Operation.Output  | 存储桶的地域  | String  | 是  | 
Bucket  | Request.Operation.Output  | 存储结果的存储桶  | String  | 是  | 
Object  | Request.Operation.Output  | 输出结果的文件名  | String  | 是  | 
响应
响应头
响应体
该响应体返回为 application/xml 数据,包含完整节点数据的内容展示如下:
<Response><JobsDetail><Code>Success</Code><Message/><JobId>j8d121820f5e411ec926ef19d53ba9c6f</JobId><State>Submitted</State><CreationTime>2022-06-27T14:44:10+0800</CreationTime><StartTime>-</StartTime><EndTime>-</EndTime><QueueId>p2242ab62c7c94486915508540933a2c6</QueueId><Tag>SuperResolution</Tag><Input><BucketId>test-123456789</BucketId><Object>input/demo.mp4</Object><Region>ap-chongqing</Region></Input><Operation><TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId><TemplateName>superresolution_demo</TemplateName><TranscodeTemplateId>t160606b9752148c4absdfaf2f55163b1f</TranscodeTemplateId><WatermarkTemplateId>t146d70eb241c44c63b6efc1cc93ccfc5d</WatermarkTemplateId><WatermarkTemplateId>t12a74d11687d444deba8a6cc52051ac27</WatermarkTemplateId><DigitalWatermark><Type>Text</Type><Message>123456789ab</Message><State>Running</State><Version>V1</Version><IgnoreError>false</IgnoreError></DigitalWatermark><Output><Region>ap-chongqing</Region><Bucket>test-123456789</Bucket><Object>output/out.mp4</Object></Output><UserData>This is my data.</UserData><JobLevel>0</JobLevel></Operation></JobsDetail></Response>
具体的数据内容如下:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 
Response  | 无  | 保存结果的容器  | Container  | 
Container 节点 Response 的内容:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 
JobsDetail  | Response  | 任务的详细信息  | Container  | 
Container 节点 JobsDetail 的内容:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 
Code  | Response.JobsDetail  | 错误码,只有 State 为 Failed 时有意义  | String  | 
Message  | Response.JobsDetail  | 错误描述,只有 State 为 Failed 时有意义  | String  | 
JobId  | Response.JobsDetail  | 新创建任务的 ID  | String  | 
Tag  | Response.JobsDetail  | 新创建任务的 Tag:SuperResolution  | String  | 
State  | Response.JobsDetail  | 任务的状态,为 Submitted、Running、Success、Failed、Pause、Cancel 其中一个  | String  | 
CreationTime  | Response.JobsDetail  | 任务的创建时间  | String  | 
StartTime  | Response.JobsDetail  | 任务的开始时间  | String  | 
EndTime  | Response.JobsDetail  | 任务的结束时间  | String  | 
QueueId  | Response.JobsDetail  | 任务所属的队列 ID  | String  | 
Input  | Response.JobsDetail  | 该任务的输入资源地址  | Container  | 
Operation  | Response.JobsDetail  | 该任务的规则  | Container  | 
Container 节点 Input 的内容:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 
Region  | Response.JobsDetail.Input  | 存储桶的地域  | String  | 
Bucket  | Response.JobsDetail.Input  | 存储结果的存储桶  | String  | 
Object  | Response.JobsDetail.Input  | 输出结果的文件名  | String  | 
Container 节点 Operation 的内容:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 
SuperResolution  | Response.JobsDetail.Operation  | 同请求中的 Request.Operation.SuperResolution  | Container  | 
TemplateId  | Response.JobsDetail.Operation  | 任务的模板 ID  | String  | 
TemplateName  | Response.JobsDetail.Operation  | 任务的模板名称, 当 TemplateId 存在时返回  | String  | 
Transcode  | Response.JobsDetail.Operation  | 同请求中的 Request.Operation.Transcode  | Container  | 
TranscodeTemplateId  | Response.JobsDetail.Operation  | 指定的转码模板 ID  | String  | 
Watermark  | Response.JobsDetail.Operation  | 同请求中的 Request.Operation.Watermark  | Container 数组  | 
WatermarkTemplateId  | Response.JobsDetail.Operation  | 指定的水印模板 ID  | String 数组  | 
Output  | Response.JobsDetail.Operation  | 同请求中的 Request.Operation.Output  | Container  | 
MediaInfo  | Response.JobsDetail.Operation  | 输出文件的媒体信息,任务未完成时不返回  | Container  | 
MediaResult  | Response.JobsDetail.Operation  | 输出文件的基本信息,任务未完成时不返回  | Container  | 
DigitalWatermark  | Response.JobsDetail.Operation  | 指定数字水印参数  | Container  | 
UserData  | Response.JobsDetail.Operation  | 透传用户信息  | String  | 
JobLevel  | Response.JobsDetail.Operation  | 任务优先级  | String  | 
Container 节点 MediaResult 的内容:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 
OutputFile  | Response.Operation.MediaResult  | 输出文件的基本信息  | Container  | 
Container 节点 OutputFile 的内容:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 
Bucket  | Response.Operation.MediaResult.OutputFile  | 输出文件所在的存储桶  | String  | 
Region  | Response.Operation.MediaResult.OutputFile  | 输出文件所在的存储桶所在的园区  | String  | 
ObjectName  | Response.Operation.MediaResult.OutputFile  | 输出文件名,可能有多个  | String 数组  | 
Md5Info  | Response.Operation.MediaResult.OutputFile  | 输出文件的 MD5 信息  | Container 数组  | 
Container 节点 Md5Info 的内容:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 
ObjectName  | Response.Operation.MediaResult.OutputFile.Md5Info  | 输出文件名  | String  | 
Md5  | Response.Operation.MediaResult.OutputFile.Md5Info  | 输出文件的 MD5 值  | Container  | 
Container 类型 DigitalWatermark 的具体数据描述如下:
节点名称(关键字)  | 父节点  | 描述  | 类型  | 
Message  | Response.Operation.DigitalWatermark  | 成功嵌入视频的数字水印的字符串信息,长度不超过64个字符,仅支持中文、英文、数字、_、-和*  | string  | 
Type  | Response.Operation.DigitalWatermark  | 水印类型,当前仅可设置为 Text  | String  | 
Version  | Response.Operation.DigitalWatermark  | 水印版本,当前仅可设置为 V1  | String  | 
IgnoreError  | Response.Operation.DigitalWatermark  | 当添加水印失败是否忽略错误继续执行任务,限制为 true/false,默认 false  | string  | 
State  | Response.Operation.DigitalWatermark  | 添加水印是否成功,执行中为Running,成功为 Success,失败为 Failed  | string  | 
错误码
实际案例
请求1:使用超分辨率模板 ID
POST /jobs HTTP/1.1Authorization: q-sign-algorithm=sha1&q-ak=AKIDZfbOAo7cllgPvF9cXFrJD0a1ICvR****&q-sign-time=1497530202;1497610202&q-key-time=1497530202;1497610202&q-header-list=&q-url-param-list=&q-signature=28e9a4986df11bed0255e97ff90500557e0ea057Host: examplebucket-1250000000.ci.ap-beijing.myqcloud.comContent-Length: 166Content-Type: application/xml<Request><Tag>SuperResolution</Tag><Input><Object>test.mp4</Object></Input><Operation><TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId><TranscodeTemplateId>t160606b9752148c4absdfaf2f55163b1f</TranscodeTemplateId><WatermarkTemplateId>t146d70eb241c44c63b6efc1cc93ccfc5d</WatermarkTemplateId><WatermarkTemplateId>t12a74d11687d444deba8a6cc52051ac27</WatermarkTemplateId><DigitalWatermark><Type>Text</Type><Message>123456789ab</Message><Version>V1</Version><IgnoreError>false</IgnoreError></DigitalWatermark><Output><Region>ap-chongqing</Region><Bucket>test-123456789</Bucket><Object>output/sr.mp4</Object></Output><UserData>This is my data.</UserData><JobLevel>0</JobLevel></Operation><QueueId>p2242ab62c7c94486915508540933a2c6</QueueId><CallBack>http://callback.demo.com</CallBack><CallBackFormat>JSON<CallBackFormat></Request>
响应1
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 230Connection: keep-aliveDate: Mon, 28 Jun 2022 15:23:12 GMTServer: tencent-cix-ci-request-id: NTk0MjdmODlfMjQ4OGY3XzYzYzhf****<Response><JobsDetail><Code>Success</Code><Message/><JobId>je8f65004eb8511eaaed4f377124a303c</JobId><State>Submitted</State><CreationTime>2019-07-07T12:12:12+0800</CreationTime><StartTime>-</StartTime><EndTime>-</EndTime><QueueId>p2242ab62c7c94486915508540933a2c6</QueueId><Tag>SuperResolution</Tag><Input><BucketId>test-123456789</BucketId><Object>input/demo.mp4</Object><Region>ap-chongqing</Region></Input><Operation><TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId><TemplateName>superresolution_demo</TemplateName><TranscodeTemplateId>t160606b9752148c4absdfaf2f55163b1f</TranscodeTemplateId><WatermarkTemplateId>t146d70eb241c44c63b6efc1cc93ccfc5d</WatermarkTemplateId><WatermarkTemplateId>t12a74d11687d444deba8a6cc52051ac27</WatermarkTemplateId><DigitalWatermark><State>Running</State><Type>Text</Type><Message>123456789ab</Message><Version>V1</Version><IgnoreError>false</IgnoreError></DigitalWatermark><Output><Region>ap-chongqing</Region><Bucket>test-123456789</Bucket><Object>output/sr.mp4</Object></Output><UserData>This is my data.</UserData><JobLevel>0</JobLevel></Operation></JobsDetail></Response>
请求2:使用超分辨率处理参数
POST /jobs HTTP/1.1Authorization:q-sign-algorithm=sha1&q-ak=AKIDZfbOAo7cllgPvF9cXFrJD0a1ICvR****&q-sign-time=1497530202;1497610202&q-key-time=1497530202;1497610202&q-header-list=&q-url-param-list=&q-signature=28e9a4986df11bed0255e97ff90500557e0ea057Host: examplebucket-1250000000.ci.ap-beijing.myqcloud.comContent-Length: 166Content-Type: application/xml<Request><Tag>SuperResolution</Tag><Input><Object>test.mp4</Object></Input><Operation><SuperResolution><Resolution>sdtohd</Resolution><EnableScaleUp>true</EnableScaleUp><Version>Enhance</Version></SuperResolution><Transcode><Container><Format>mp4</Format></Container><Video><Codec>H.264</Codec><Profile>high</Profile><Bitrate>1000</Bitrate><Width>1280</Width><Fps>30</Fps><Preset>medium</Preset></Video><Audio><Codec>aac</Codec><Samplerate>44100</Samplerate><Bitrate>128</Bitrate><Channels>4</Channels></Audio><TransConfig><AdjDarMethod>scale</AdjDarMethod><IsCheckReso>false</IsCheckReso><ResoAdjMethod>1</ResoAdjMethod></TransConfig><TimeInterval><Start>0</Start><Duration>60</Duration></TimeInterval></Transcode><Watermark><Type>Text</Type><LocMode>Absolute</LocMode><Dx>128</Dx><Dy>128</Dy><Pos>TopRight</Pos><StartTime>0</StartTime><EndTime>100.5</EndTime><Text><Text>水印内容</Text><FontSize>30</FontSize><FontType>simfang.ttf</FontType><FontColor>0xRRGGBB</FontColor><Transparency>30</Transparency></Text></Watermark><DigitalWatermark><Type>Text</Type><Message>123456789ab</Message><Version>V1</Version><IgnoreError>false</IgnoreError></DigitalWatermark><Output><Region>ap-chongqing</Region><Bucket>test-123456789</Bucket><Object>output/sr.mp4</Object></Output><UserData>This is my data.</UserData><JobLevel>0</JobLevel></Operation><QueueId>p2242ab62c7c94486915508540933a2c6</QueueId><CallBack>http://callback.demo.com</CallBack><CallBackFormat>JSON<CallBackFormat></Request>
响应2
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 230Connection: keep-aliveDate: Mon, 28 Jun 2022 15:23:12 GMTServer: tencent-cix-ci-request-id: NTk0MjdmODlfMjQ4OGY3XzYzYzhf****<Response><JobsDetail><Code>Success</Code><Message/><JobId>je8f65004eb8511eaaed4f377124a303c</JobId><State>Submitted</State><CreationTime>2019-07-07T12:12:12+0800</CreationTime><StartTime>-</StartTime><EndTime>-</EndTime><QueueId>p2242ab62c7c94486915508540933a2c6</QueueId><Tag>SuperResolution</Tag><Input><BucketId>test-123456789</BucketId><Object>input/demo.mp4</Object><Region>ap-chongqing</Region></Input><Operation><SuperResolution><Resolution>sdtohd</Resolution><EnableScaleUp>true</EnableScaleUp><Version>Enhance</Version></SuperResolution><Transcode><Container><Format>mp4</Format></Container><Video><Codec>H.264</Codec><Profile>high</Profile><Bitrate>1000</Bitrate><Width>1280</Width><Fps>30</Fps><Preset>medium</Preset></Video><Audio><Codec>aac</Codec><Samplerate>44100</Samplerate><Bitrate>128</Bitrate><Channels>4</Channels></Audio><TransConfig><AdjDarMethod>scale</AdjDarMethod><IsCheckReso>false</IsCheckReso><ResoAdjMethod>1</ResoAdjMethod></TransConfig><TimeInterval><Start>0</Start><Duration>60</Duration></TimeInterval></Transcode><Watermark><Type>Text</Type><LocMode>Absolute</LocMode><Dx>128</Dx><Dy>128</Dy><Pos>TopRight</Pos><StartTime>0</StartTime><EndTime>100.5</EndTime><Text><Text>水印内容</Text><FontSize>30</FontSize><FontType>simfang.ttf</FontType><FontColor>0xRRGGBB</FontColor><Transparency>30</Transparency></Text></Watermark><DigitalWatermark><State>Running</State><Type>Text</Type><Message>123456789ab</Message><Version>V1</Version><IgnoreError>false</IgnoreError></DigitalWatermark><Output><Region>ap-chongqing</Region><Bucket>test-123456789</Bucket><Object>output/sr.mp4</Object></Output><UserData>This is my data.</UserData><JobLevel>0</JobLevel></Operation></JobsDetail></Response>