tencent cloud

Submitting Video DNA Task
Last updated:2025-09-08 19:16:11
Submitting Video DNA Task
Last updated: 2025-09-08 19:16:11

Feature Overview

Submit a video DNA task. The video DNA task supports video storage, duplicate detection, and retrieval operations.
Note:
To use Video DNA, you need to create a Video DNA library in advance. Click submit a ticket to create a DNA library.

Authorization Guide

When submitting a Video DNA task using a sub-account, you need to set action to ci:CreateMediaJobs in the authorization policy. For all operation APIs supported by Cloud Infinite, please refer to action.
Also, you need to grant the cam:PassRole permission for role passing, making it easy for the asynchronous processing API to perform read and write operations on COS resources through CAM's "role".

Service Activation

Using this feature requires enabling Cloud Infinite in advance and binding a bucket.
Using this feature requires enabling Media Processing Service in advance through the Console or API.

Use Limits

When using this API, please first confirm the relevant restrictions. For details, see Specifications and Limits.

Fee Description

This API is a paid service. The incurred fees will be collected by Cloud Infinite. For detailed billing information, see Media Processing Fees.
The billing standard for Video DNA aligns with video tags and is calculated based on video processing duration. For example: a video with a storage duration of 10 minutes and a duplication duration of 5 minutes costs: 10 * 0.05 CNY/minute + 5 * 0.05 CNY/minute = 0.75 CNY.

Request

Request Sample

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>
Note:
Authorization: Auth String. For details, see Request Signature documentation.

Request Header

This API only uses common request headers. For details, see Common Request Headers documentation.

Request Body

The implementation of this request operation requires the following request body.
<Request>
<Tag>DNA</Tag>
<Input>
<Object>input/demo.mp4</Object>
</Input>
<Operation>
<DnaConfig>
<RuleType>GetFingerPrint</RuleType>
<DnaDbId>Db0fafe624fec211edbdc852540083a8ba</DnaDbId>
</DnaConfig>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
<CallBack>http://callback.demo.com</CallBack>
<CallBackFormat>JSON</CallBackFormat>
</Request>
The data are described as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required
Request
None
Container for saving requests
Container
Yes
The data description of container Request is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required
Tag
Request
Tag for creating task: DNA
String
Yes
Input
Request
File information to be operated
Container
Yes
Operation
Request
Operation rule
Container
Yes
CallBackFormat
Request
Task callback format, JSON or XML, default XML, which has a higher priority than the callback format of the queue
String
No
CallBackType
Request
Task callback type, URL or TDMQ, default URL, which has a higher priority than the callback type of the queue
String
No
CallBack
Request
Task callback address, which has a higher priority than the callback address of the queue. When set to "no", the callback address will not trigger a callback.
String
No
CallBackMqConfig
Request
Task callback TDMQ configuration, required when CallBackType is TDMQ. For details, see CallBackMqConfig.
Container
No
The data description of container Input is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required
Object
Request.Input
Input file path. Currently, the input video only supports MP4 format, with a video length less than 1800s.
String
Yes
The data description of container
Operation
is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required
DnaConfig
Request.Operation
Video DNA task parameters
Container
Yes
JobLevel
Request.Operation
Task priority, level limit: 0, 1, 2. Higher levels indicate higher task priority, default is 0.
String
No
UserData
Request.Operation
Pass through user information
String
No
The data description of container DnaConfig is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Required
RuleType
Request.Operation.DnaConfig
DNA task type
GetFingerPrint: Extract video fingerprint and store it in the DNA library
FindSimilarVideo: Perform video duplicate detection from the DNA library
DeleteFingerPrint: Delete video from the DNA library
String
Yes
DnaDbId
Request.Operation.DnaConfig
DNA library ID
String
Yes
VideoId
Request.Operation.DnaConfig
Unique video ID, required and valid only when RuleType is DeleteVideoPrint
String
No

Response

Response Header

This API only returns common response headers. For details, see Common Response Headers documentation.

Response Body

The response body is returned as application/xml. An example including the complete node data is shown below:
<Response>
<JobsDetail>
<Code>Success</Code>
<Message>SUCCESS</Message>
<Input>
<BucketId>test-123456789</BucketId>
<Object>input/demo.mp4</Object>
<Region>ap-chongqing</Region>
</Input>
<JobId>j8d121820f5e411ec926ef19d53ba9c6f</JobId>
<State>Submitted</State>
<CreationTime>2022-06-27T15:23:10+0800</CreationTime>
<StartTime>-</StartTime>
<EndTime>-</EndTime>
<QueueId>p2242ab62c7c94486915508540933a2c6</QueueId>
<Tag>DNA</Tag>
<Operation>
<DNAResult>
<Detection>
<Audio>
<Similar>100</Similar>
</Audio>
<Duration>10</Duration>
<MatchDetail>
<MatchEndTime>9</MatchEndTime>
<MatchStartTime>0</MatchStartTime>
<SrcEndTime>9</SrcEndTime>
<SrcStartTime>0</SrcStartTime>
</MatchDetail>
<Similar>100</Similar>
<SimilarDuration>10</SimilarDuration>
<VideoId>dv2b162b7d005011eeb67352540083a8ba</VideoId>
</Detection>
<Detection>
<Audio>
<Similar>100</Similar>
</Audio>
<Duration>10</Duration>
<MatchDetail>
<MatchEndTime>9</MatchEndTime>
<MatchStartTime>0</MatchStartTime>
<SrcEndTime>9</SrcEndTime>
<SrcStartTime>0</SrcStartTime>
</MatchDetail>
<Similar>100</Similar>
<SimilarDuration>10</SimilarDuration>
<VideoId>dv9fb4b5d3004d11eeb67352540083a8ba</VideoId>
</Detection>
<Duration>10</Duration>
<VideoId>dvef8cd08e006511eeb67352540083a8ba</VideoId>
</DNAResult>
<DnaConfig>
<DnaDbId>Db0fafe624fec211edbdc852540083a8ba</DnaDbId>
<RuleType>FindSimilarVideo</RuleType>
</DnaConfig>
<JobLevel>0</JobLevel>
</Operation>
</JobsDetail>
</Response>
The data content is as follows:
Node Name (Keyword)
Parent Node
Description
Type
Response
None
Container for saving results
Container
The content of container node Response:
Node Name (Keyword)
Parent Node
Description
Type
JobsDetail
Response
Task detailed information
Container array
The content of container node
JobsDetail
:
Node Name (Keyword)
Parent Node
Description
Type
Code
Response.JobsDetail
Error code, which takes effect when State is Failed.
String
Message
Response.JobsDetail
Error description, which takes effect when State is Failed.
String
JobId
Response.JobsDetail
ID of the newly created task
String
Tag
Response.JobsDetail
Tag for the newly created task: DNA
String
State
Response.JobsDetail
Task Status
Submitted: submitted, pending execution
Running: executing
Success: execution successful
Failed: execution failed
Pause: Task pause. When the pause queue is triggered, to-be-executed tasks become paused state.
Cancel: task cancelled
String
CreationTime
Response.JobsDetail
Task Creation Time
String
StartTime
Response.JobsDetail
Task Start Time
String
EndTime
Response.JobsDetail
Task End Time
String
QueueId
Response.JobsDetail
Queue ID of the task
String
Input
Response.JobsDetail
Input resource address of the task
Container
Operation
Response.JobsDetail
The rules of the task
Container
The content of container node Input:
Node Name (Keyword)
Parent Node
Description
Type
Region
Response.JobsDetail.Input
Region of the storage bucket
String
Bucket
Response.JobsDetail.Input
Bucket for storing results
String
Object
Response.JobsDetail.Input
Filename of the output result
String
The content of container node Operation:
Node Name (Keyword)
Parent Node
Description
Type
DnaConfig
Response.JobsDetail.Operation
Same as Request.Operation.DnaConfig in progress
Container
DnaResult
Response.JobsDetail.Operation
DNA task result, not returned when the task is not completed
Container
UserData
Response.JobsDetail.Operation
Pass through user information
String
JobLevel
Response.JobsDetail.Operation
Task Priority
String
The content of container node DnaResult:
Node Name (Keyword)
Parent Node
Description
Type
VideoId
Response.JobsDetail.Operation.DnaResult
Unique ID of the input video
String
Duration
Response.JobsDetail.Operation.DnaResult
Duration of the input video, in seconds
Integer
Detection
Response.JobsDetail.Operation.DnaResult
Similar video details
Container array
The content of container node Detection:
Node Name (Keyword)
Parent Node
Description
Type
VideoId
Response.JobsDetail.Operation.DnaResult.Detection
VideoId of the matched video
String
Similar
Response.JobsDetail.Operation.DnaResult.Detection
Similarity
Integer
SimilarDuration
Response.JobsDetail.Operation.DnaResult.Detection
Segment duration of similar clips
Integer
Duration
Response.JobsDetail.Operation.DnaResult.Detection
Video duration
Integer
MatchDetail
Response.JobsDetail.Operation.DnaResult.Detection
Matching details
Container array
Audio
Response.JobsDetail.Operation.DnaResult.Detection
Audio similarity details
Container
The content of container node MatchDetail:
Node Name (Keyword)
Parent Node
Description
Type
MatchStartTime
Response.JobsDetail.Operation.DnaResult.Detection.MatchDetail
Start time of similar video matching, in seconds
Integer
MatchEndTime
Response.JobsDetail.Operation.DnaResult.Detection.MatchDetail
End time of similar video matching, in seconds
Integer
SrcStartTime
Response.JobsDetail.Operation.DnaResult.Detection.MatchDetail
Start time of source video matching, in seconds
Integer
SrcEndTime
Response.JobsDetail.Operation.DnaResult.Detection.MatchDetail
End time of source video matching, in seconds
Integer
The content of container node Audio:
Node Name (Keyword)
Parent Node
Description
Type
Similar
Response.JobsDetail.Operation.DnaResult.Detection.Audio
Audio similarity
Integer

Error Codes

This request returns common error responses and error codes. For more information, see Error Codes.

Practical Example

Request

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

<Request>
<Tag>DNA</Tag>
<Input>
<Object>input/demo.mp4</Object>
</Input>
<Operation>
<DnaConfig>
<RuleType>GetFingerPrint</RuleType>
<DnaDbId>Db0fafe624fec211edbdc852540083a8ba</DnaDbId>
</DnaConfig>
<UserData>This is my data.</UserData>
<JobLevel>0</JobLevel>
</Operation>
<CallBack>http://callback.demo.com</CallBack>
<CallBackFormat>JSON</CallBackFormat>
</Request>

Response

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>
<CreationTime>2022-06-27T15:23:10+0800</CreationTime>
<StartTime>-</StartTime>
<EndTime>-</EndTime>
<QueueId>p2242ab62c7c94486915508540933a2c6</QueueId>
<Tag>DNA</Tag>
<Input>
<BucketId>test-123456789</BucketId>
<Object>input/demo.mp4</Object>
<Region>ap-chongqing</Region>
</Input>
<Operation>
<DNAResult>
<Detection>
<Audio>
<Similar>100</Similar>
</Audio>
<Duration>10</Duration>
<MatchDetail>
<MatchEndTime>9</MatchEndTime>
<MatchStartTime>0</MatchStartTime>
<SrcEndTime>9</SrcEndTime>
<SrcStartTime>0</SrcStartTime>
</MatchDetail>
<Similar>100</Similar>
<SimilarDuration>10</SimilarDuration>
<VideoId>dv2b162b7d005011eeb67352540083a8ba</VideoId>
</Detection>
<Detection>
<Audio>
<Similar>100</Similar>
</Audio>
<Duration>10</Duration>
<MatchDetail>
<MatchEndTime>9</MatchEndTime>
<MatchStartTime>0</MatchStartTime>
<SrcEndTime>9</SrcEndTime>
<SrcStartTime>0</SrcStartTime>
</MatchDetail>
<Similar>100</Similar>
<SimilarDuration>10</SimilarDuration>
<VideoId>dv9fb4b5d3004d11eeb67352540083a8ba</VideoId>
</Detection>
<Duration>10</Duration>
<VideoId>dvef8cd08e006511eeb67352540083a8ba</VideoId>
</DNAResult>
<DnaConfig>
<DnaDbId>Db0fafe624fec211edbdc852540083a8ba</DnaDbId>
<RuleType>GetFingerPrint</RuleType>
</DnaConfig>
<JobLevel>0</JobLevel>
</Operation>
</JobsDetail>
</Response>

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback