媒体处理机制介绍

最近更新时间:2024-11-06 17:21:52

我的收藏

简介

数据万象提供了一套完善便捷的媒体处理机制,通过这套机制可以对存储在对象存储 COS 中的媒体对象进行各类型处理操作。
媒体处理机制分为以下几种方式:
方式
类别
说明
通过裸参数提交任务
持久化处理
提交媒体处理任务,并在提交任务时设置好 媒体处理任务所需参数
通过模板设置提交任务
持久化处理
于提交媒体处理任务前设置好处理模板,并在提交任务 选择所需模板
工作流处理
持久化处理
可将不同的任务类型组合成为工作流,将工作流设置好并开启工作流后,上传 COS 后的文件会 自动触发工作流处理流程
批量处理
持久化处理
针对 COS 上已经存在的数据进行批量处理,处理方式与提交任务类似,确认需要处理的数据范围与处理类型后 提交批量任务
同步任务
同步处理
在媒体对象的 URL 后加上 媒体处理参数

通过裸参数提交任务

您可以在每次提交媒体处理任务时,灵活地配置 媒体处理任务所需参数
说明
通过裸参数提交任务时不需要设置模板。

请求语法

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

<body>

请求示例:通过裸参数提交音视频转码任务

POST /jobs 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>
<Tag>Transcode</Tag>
<Input>
<Object>input/demo.mp4</Object>
</Input>
<Operation>
<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>
<AudioMixArray>
<AudioSource>https://test-xxx.cos.ap-chongqing.myqcloud.com/mix1.mp3</AudioSource>
<MixMode>Once</MixMode>
<Replace>true</Replace>
<EffectConfig>
<EnableStartFadein>true</EnableStartFadein>
<StartFadeinTime>3</StartFadeinTime>
<EnableEndFadeout>false</EnableEndFadeout>
<EndFadeoutTime>0</EndFadeoutTime>
<EnableBgmFade>true</EnableBgmFade>
<BgmFadeTime>1.7</BgmFadeTime>
</EffectConfig>
</AudioMixArray>
<AudioMixArray>
<AudioSource>https://test-xxx.cos.ap-chongqing.myqcloud.com/mix2.mp3</AudioSource>
<MixMode>Once</MixMode>
<Replace>true</Replace>
<EffectConfig>
<EnableStartFadein>true</EnableStartFadein>
<StartFadeinTime>3</StartFadeinTime>
<EnableEndFadeout>false</EnableEndFadeout>
<EndFadeoutTime>0</EndFadeoutTime>
<EnableBgmFade>true</EnableBgmFade>
<BgmFadeTime>1.7</BgmFadeTime>
</EffectConfig>
</AudioMixArray>
</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>
<RemoveWatermark>
<Dx>150</Dx>
<Dy>150</Dy>
<Width>75</Width>
<Height>75</Height>
</RemoveWatermark>
<Subtitles>
<Subtitle>
<Url>https://test-xxx.cos.ap-chongqing.myqcloud.com/test1.srt</Url>
</Subtitle>
<Subtitle>
<Url>https://test-xxx.cos.ap-chongqing.myqcloud.com/test2.srt</Url>
</Subtitle>
</Subtitles>
<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.${ext}</Object>
</Output>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
<CallBack>http://callback.demo.com</CallBack>
<CallBackFormat>JSON<CallBackFormat>
</Request>

返回

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 230
Connection: keep-alive
Date: Mon, 28 Jun 2022 15:23:12 GMT
Server: tencent-ci
x-ci-request-id: NTk0MjdmODlfMjQ4OGY3XzYzYzhf****

<Response>
<JobsDetail>
<Code>Success</Code>
<Message/>
<JobId>j8d121820f5e411ec926ef19d53ba9c6f</JobId>
<State>Submitted</State>
<Progress>0</Progress>
<CreationTime>2022-06-27T15:23:10+0800</CreationTime>
<StartTime>-</StartTime>
<EndTime>-</EndTime>
<QueueId>p2242ab62c7c94486915508540933a2c6</QueueId>
<Tag>Transcode</Tag>
<Input>
<BucketId>test-123456789</BucketId>
<Object>input/demo.mp4</Object>
<Region>ap-chongqing</Region>
</Input>
<Operation>
<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>
<AudioMixArray>
<AudioSource>https://test-xxx.cos.ap-chongqing.myqcloud.com/mix1.mp3</AudioSource>
<MixMode>Once</MixMode>
<Replace>true</Replace>
<EffectConfig>
<EnableStartFadein>true</EnableStartFadein>
<StartFadeinTime>3</StartFadeinTime>
<EnableEndFadeout>false</EnableEndFadeout>
<EndFadeoutTime>0</EndFadeoutTime>
<EnableBgmFade>true</EnableBgmFade>
<BgmFadeTime>1.7</BgmFadeTime>
</EffectConfig>
</AudioMixArray>
<AudioMixArray>
<AudioSource>https://test-xxx.cos.ap-chongqing.myqcloud.com/mix2.mp3</AudioSource>
<MixMode>Once</MixMode>
<Replace>true</Replace>
<EffectConfig>
<EnableStartFadein>true</EnableStartFadein>
<StartFadeinTime>3</StartFadeinTime>
<EnableEndFadeout>false</EnableEndFadeout>
<EndFadeoutTime>0</EndFadeoutTime>
<EnableBgmFade>true</EnableBgmFade>
<BgmFadeTime>1.7</BgmFadeTime>
</EffectConfig>
</AudioMixArray>
</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></FontType>
<FontColor>0xRRGGBB</FontColor>
<Transparency>30</Transparency>
</Text>
</Watermark>
<RemoveWatermark>
<Dx>150</Dx>
<Dy>150</Dy>
<Width>75</Width>
<Height>75</Height>
</RemoveWatermark>
<Subtitles>
<Subtitle>
<Url>https://test-xxx.cos.ap-chongqing.myqcloud.com/test1.srt</Url>
</Subtitle>
<Subtitle>
<Url>https://test-xxx.cos.ap-chongqing.myqcloud.com/test2.srt</Url>
</Subtitle>
</Subtitles>
<DigitalWatermark>
<Type>Text</Type>
<Message>123456789ab</Message>
<Version>V1</Version>
<IgnoreError>false</IgnoreError>
<State>Running</State>
</DigitalWatermark>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-123456789</Bucket>
<Object>output/out.${ext}</Object>
</Output>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
</JobsDetail>
</Response>

通过模板设置提交任务

通过设置模板 能帮助您简化操作,设置模板后,您后期在业务中可以多次复用,帮助您提升处理效率。

请求语法

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

请求示例:设置模板后提交音视频转码任务

POST /jobs 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>
<Tag>Transcode</Tag>
<Input>
<Object>input/demo.mp4</Object>
</Input>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<WatermarkTemplateId>t1318c5f428d474afba1797f84091cbe22</WatermarkTemplateId>
<WatermarkTemplateId>t1318c5f428d474afba1797f84091cbe23</WatermarkTemplateId>
<WatermarkTemplateId>t1318c5f428d474afba1797f84091cbe24</WatermarkTemplateId>
<RemoveWatermark>
<Dx>150</Dx>
<Dy>150</Dy>
<Width>75</Width>
<Height>75</Height>
</RemoveWatermark>
<Subtitles>
<Subtitle>
<Url>https://test-xxx.cos.ap-chongqing.myqcloud.com/test1.srt</Url>
</Subtitle>
<Subtitle>
<Url>https://test-xxx.cos.ap-chongqing.myqcloud.com/test2.srt</Url>
</Subtitle>
</Subtitles>
<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.${ext}</Object>
</Output>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
<CallBack>http://callback.demo.com</CallBack>
<CallBackFormat>JSON<CallBackFormat>
</Request>


返回内容

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 230
Connection: keep-alive
Date: Mon, 28 Jun 2022 15:23:12 GMT
Server: tencent-ci
x-ci-request-id: NTk0MjdmODlfMjQ4OGY3XzYzYzhf****

<Response>
<JobsDetail>
<Code>Success</Code>
<Message/>
<JobId>j8d121820f5e411ec926ef19d53ba9c6f</JobId>
<State>Submitted</State>
<Progress>0</Progress>
<CreationTime>2022-06-27T15:23:11+0800</CreationTime>
<StartTime>-</StartTime>
<EndTime>-</EndTime>
<QueueId>p2242ab62c7c94486915508540933a2c6</QueueId>
<Tag>Transcode</Tag>
<Input>
<BucketId>test-123456789</BucketId>
<Object>input/demo.mp4</Object>
<Region>ap-chongqing</Region>
</Input>
<Operation>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
<TemplateName>trans_993874</TemplateName>
<WatermarkTemplateId>t1318c5f428d474afba1797f84091cbe22</WatermarkTemplateId>
<WatermarkTemplateId>t1318c5f428d474afba1797f84091cbe23</WatermarkTemplateId>
<WatermarkTemplateId>t1318c5f428d474afba1797f84091cbe24</WatermarkTemplateId>
<RemoveWatermark>
<Dx>150</Dx>
<Dy>150</Dy>
<Width>75</Width>
<Height>75</Height>
</RemoveWatermark>
<Subtitles>
<Subtitle>
<Url>https://test-xxx.cos.ap-chongqing.myqcloud.com/test1.srt</Url>
</Subtitle>
<Subtitle>
<Url>https://test-xxx.cos.ap-chongqing.myqcloud.com/test2.srt</Url>
</Subtitle>
</Subtitles>
<DigitalWatermark>
<Type>Text</Type>
<Message>123456789ab</Message>
<Version>V1</Version>
<IgnoreError>false</IgnoreError>
<State>Running</State>
</DigitalWatermark>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-123456789</Bucket>
<Object>output/out.${ext}</Object>
</Output>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
</JobsDetail>
</Response>

工作流处理

工作流可将不同任务节点进行组合以适配您的业务,您将文件上传 COS 时可 自动触发工作流处理,并将结果存入到 COS。

请求语法

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>

请求示例:对于输入的视频进行截图和转码处理。转码后, 同时转封装和生成智能封面, 最后做图片处理。

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-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>
<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: NjJmMWQxYjNfOTBmYTUwNjRfNWYyY18x

<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>

批量处理

批量任务处理可对已上传 COS 的历史文件进行单任务类型处理或按照工作流中配置的操作自动化处理,您可指定处理的数据范围后 提交批量任务

请求语法

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

请求示例:提交一个音视频转码批量任务

POST /inventorytriggerjob 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:bucket-1250000000.ci.ap-beijing.myqcloud.com
Content-Length: 166
Content-Type: application/xml

<Request>
<Name>demo</Name>
<Type>Job</Type>
<Input>
<Prefix>input</Prefix>
</Input>
<Operation>
<TimeInterval>
<Start>2022-02-01T12:00:00+0800</Start>
<End>2022-05-01T12:00:00+0800</End>
</TimeInterval>
<UserData>this is my inventorytriggerjob</UserData>
<CallBack>https://www.callback.com</CallBack>
<Tag>Transcode</Tag>
<JobParam>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
</JobParam>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>output/${InventoryTriggerJobId}/out.mp4</Object>
</Output>
<JobLevel>0</JobLevel>
</Operation>
</Request>

返回

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 230
Connection: keep-alive
Date: Mon, 28 Jun 2022 15:23:12 GMT
Server: tencent-ci
x-ci-request-id: NjJiZDU1ZmZfOTBmYTUwNjRfNzdjY18xYQ==

<Response>
<RequestId>NjJiZDU1ZmZfOTBmYTUwNjRfNzdjY18xYQ==<RequestId>
<JobsDetail>
<Code>Success</Code>
<Type>Job</Type>
<Message/>
<Name>demo</Name>
<JobId>be8f65004eb8511eaaed4f377124a303c</JobId>
<State>Running</State>
<CreationTime>2022-06-27T15:23:10+0800</CreationTime>
<StartTime>2022-06-27T15:23:11+0800</StartTime>
<EndTime>2022-06-27T15:25:10+0800</EndTime>
<Input>
<Prefix>input</Prefix>
</Input>
<Operation>
<TimeInterval>
<Start>2022-02-01T12:00:00+0800</Start>
<End>2022-05-01T12:00:00+0800</End>
</TimeInterval>
<QueueId>p893bcda225bf4945a378da6662e81a89</QueueId>
<UserData>this is my inventorytriggerjob</UserData>
<CallBack>https://www.callback.com</CallBack>
<Tag>Transcode</Tag>
<JobParam>
<TemplateId>t1460606b9752148c4ab182f55163ba7cd</TemplateId>
</JobParam>
<Output>
<Region>ap-chongqing</Region>
<Bucket>test-1234567890</Bucket>
<Object>output/${InventoryTriggerJobId}/out.mp4</Object>
</Output>
<JobLevel>0</JobLevel>
</Operation>
</JobsDetail>
</Response>

同步任务

您可以通过在媒体文件的 URL 后加上 媒体处理参数,实现访问视频文件的时候 同步获取视频截帧 、封面等功能。

请求示例1:通过 GET 请求方式

https://<BucketName-APPID>.cos.<Region>.myqcloud.com/for-test.mp4?ci-process=snapshot&time=1&format=jpg&<Auth String>

请求示例2:通过 URL 地址添加参数方式

GET /<ObjectKey>?ci-process=snapshot&time=1&format=jpg HTTP/1.1
Host: <BucketName-APPID>.cos.<Region>.myqcloud.com
Date: <GMT Date>
Authorization: <Auth String>
Content-Length: <length>