QuerySmarttagJob
Queries a smart tag job.
Operation description
The response data of this operation includes data obtained through intelligent algorithm analysis, such as figures, scenes, and keywords in a video.
The smart tag feature is currently available only in the China (Beijing), China (Shanghai), and China (Hangzhou) regions. Other regions are not supported.
QPS limit
The queries per second (QPS) limit on this API operation is 100 calls per second for a single user. If the limit is exceeded, API calls are throttled, which may affect your business. Plan your API calls accordingly. For more information, see QPS limit.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mts:QuerySmarttagJob |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| JobId |
string |
Yes |
The ID of the smart tag job to query. You can obtain the ID from the response parameters of the Submit a smart tag job operation. |
39f8e0bc005e4f309379701645f4**** |
| Params |
string |
No |
The additional request parameters, represented as a JSON string. Example:
|
{"labelResultType":"auto"} |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| JobStatus |
string |
The status of the job. Valid values:
|
Success |
| Message |
string |
The message about job processing. |
Job Success! |
| RequestId |
string |
The ID of the request. |
7B117AF5-2A16-412C-B127-FA6175ED1AD0 |
| Results |
object |
||
| Result |
array<object> |
The array of analysis result objects. |
|
|
object |
The details of the array of analysis result objects. |
||
| Data |
string |
The specific data of the analysis results, represented as a JSON string. For the data structures of different types, see the Result parameter description section below. |
{"title":"example-title-****"} |
| Type |
string |
The type of the analysis result.
|
Meta |
| UserData |
string |
The information passed through when a callback is triggered by Message Service (MNS). For the message format, see the Callback message format definition section below. |
example UserData **** |
Callback message format definition
When the execution status of a smart tag job changes, ApsaraVideo Media Processing (MPS) sends a message to the queue specified by the user. For more information about how to specify a callback queue, see the MPS update pipeline operation. The message body is a JSON string that contains the following fields:
| Name | Type | Description |
| Type | String | The fixed string "smarttag", which indicates a smart tag job. |
| JobId | String | The unique ID of the job. |
| State | String | The current status of the job, which is the same as the JobStatus parameter in QuerySmarttagJob. |
| UserData | String | The UserData parameter passed by the user in SubmitSmarttagJob. |
Result parameter description
VideoLabel data structure.
| Name | Type | Description |
| persons | JSONArray | The detected figure results. |
| persons.name | String | The name of the recognized figure. |
| persons.category | String | The figure type. Valid values: celebrity (celebrity), politician (politician), sensitive (sensitive figure), unknown (unknown figure), and the ID of the custom figure library (returned when the recognized figure is a custom figure). |
| persons.ratio | double | The appearance rate of the figure. Valid values: 0 to 1. |
| persons.occurrences | JSONArray | The details of the figure's appearances. |
| persons.occurrences.score | double | The confidence score. |
| persons.occurrences.from | double | The start time when the figure is detected, in seconds. |
| persons.occurrences.to | double | The end time when the figure is detected, in seconds. |
| persons.occurrences.position | JSONObject | The face coordinates. |
| persons.occurrences.position.leftTop | int[] | The x and y coordinates of the upper-left corner. |
| persons.occurrences.position.rightBottom | int[] | The x and y coordinates of the lower-right corner. |
| persons.occurrences.timestamp | double | The timestamp of the face coordinates, in seconds. |
| persons.occurrences.scene | String | The figure shot type. Valid values: closeUp (close-up), medium-closeUp (medium close-up), medium (medium shot), and medium-long (full shot). |
| tags | JSONArray | The detected tags for objects and scenes. For examples, see the following table. |
| tags.mainTagName | String | The main tag. |
| tags.subTagName | String | The sub-tag. |
| tags.ratio | double | The appearance rate. Valid values: 0 to 1. |
| tags.occurrences | JSONArray | The details of the appearances. |
| tags.occurrences.score | double | The confidence score. |
| tags.occurrences.from | double | The start time, in seconds. |
| tags.occurrences.to | double | The end time, in seconds. |
| classifications | JSONArray | The video classification information. |
| classifications.score | double | The confidence score. |
| classifications.category1 | String | The level-1 category, such as life, anime, and automobile. |
| classifications.category2 | String | The level-2 category. For example, the life category can be subdivided into health and home. |
Examples of video tags.
| mainTagName | subTagName |
| Program | Examples: Where Are We Going, Dad?, Super Comedian |
| Character role | Examples: doctor, nurse, and teacher |
| Object | Examples: piano, water cup, desk, scrambled eggs with tomatoes, car, and cosmetics |
| Logo | Examples: CCTV1, CCTV2, Youku, and Dragon TV |
| Action event | Examples: dancing, kissing, hugging, meeting, singing, making a phone call, horse riding, and fighting |
| Region | Examples: Tiananmen Square in Beijing, Statue of Liberty, Leshan Giant Buddha, China, and United States |
| Scene | Examples: bedroom, subway station, terraced field, beach, and desert |
ImageLabel data structure.
| Name | Type | Description |
| persons | JSONArray | The detected figure results. |
| persons.name | String | The name of the recognized figure. |
| persons.category | String | The figure type. Valid values: celebrity (celebrity), politician (politician), and sensitive (sensitive figure). |
| persons.score | double | The confidence score of the figure. |
| persons.position | JSONObject | The face coordinates. |
| persons.position.leftTop | int[] | The x and y coordinates of the upper-left corner. |
| persons.position.rightBottom | int[] | The x and y coordinates of the lower-right corner. |
| persons.scene | String | The figure shot type. Valid values: closeUp (close-up), medium-closeUp (medium close-up), medium (medium shot), and medium-long (full shot). |
| tags | JSONArray | The detected tags for objects and scenes. For examples, see the following table. |
| tags.mainTagName | String | The main tag. |
| tags.subTagName | String | The sub-tag. |
| tags.score | double | The confidence score. |
Examples of image tags.
| mainTagName | subTagName |
| Character role | Examples: doctor, nurse, and teacher |
| Region | Examples: Tiananmen Square in Beijing, Statue of Liberty, Leshan Giant Buddha, China, and United States |
| Action event | Examples: speaking |
| Logo | Examples: CCTV1, CCTV2, Youku, and Dragon TV |
| Action event | Examples: dancing, kissing, hugging, meeting, singing, making a phone call, horse riding, and fighting |
| Object | Examples: piano, water cup, desk, scrambled eggs with tomatoes, car, and cosmetics |
| Scene | Examples: bedroom, subway station, terraced field, beach, and desert |
TextLabel data structure (derived from ASR and OCR)
| Name | Type | Description |
| tags | JSONArray | The text tag information. For examples, see the following table. |
| tags.name | String | The tag category. |
| tags.value | String | The tag values. Multiple tag values are separated by commas (,). |
Examples of text tags.
| name | value |
| Region | Examples: Tiananmen Square in Beijing, Statue of Liberty, Leshan Giant Buddha, China, and United States |
| Organization | Examples: China Wildlife Conservation Association and China Media Group |
| Logo | Examples: Nike and Li-Ning |
| Keyword | Examples: core force |
CPVLabel data structure.
cates: categories (level-1, level-2, and level-3 categories).
entities: category attributes (with knowledge graph information).
hotwords: hot words (watchlist of users).
freeTags: free tags (keywords).
| Name | Type | Example | Description |
| type | String | hmi | The result type. Valid values: hmi (human-machine collaboration results) and autp (machine tagging results). |
| cates | JSONArray | - | The classification category results. |
| cates.labelLevel1 | String | Tourism | The level-1 tag. |
| cates.labelLevel2 | String | Tourism scenery | The level-2 tag. |
| cates.label | String | "" | The tag name. The algorithm may return an empty string. |
| cates.appearanceProbability | double | 0.96 | The appearance rate. |
| cates.detailInfo | JSONArray | - | - |
| cates.detailInfo.score | double | 0.9 | The confidence score. |
| cates.detailInfo.startTime | double | 0.021 | The start time. |
| cates.detailInfo.endTime | double | 29.021 | The end time. |
| entities | JSONArray | - | - |
| entities.labelLevel1 | String | Region | The level-1 tag. |
| entities.labelLevel2 | String | Landmark | The level-2 tag. |
| entities.label | String | Huangguoshu Waterfall | The tag name. |
| entities.appearanceProbability | double | 0.067 | The appearance rate. |
| entities.knowledgeInfo | String | {"name": "Huangguoshu Waterfall", "nameEn": "Huangguoshu Waterfall", "description": "One of the four major waterfalls in Asia"} | The knowledge graph information. For all fields, see the attached tables: Film and TV IP graph, Music graph, Figure graph, Landmark graph, and Object graph. |
| entities.detailInfo | JSONArray | - | - |
| entities.detailInfo.score | double | 0.33292606472969055 | The confidence score. |
| entities.detailInfo.startTime | double | 6.021 | The start time. |
| entities.detailInfo.endTime | double | 8.021 | The end time. |
| entities.detailInfo.trackData | JSONArray | - | The structured information of the entity tag. |
| entities.detailInfo.trackData.score | double | 0.32 | The confidence score. |
| entities.detailInfo.trackData.bbox | integer[] | 23, 43, 45, 67 | The bounding box coordinates. |
| entities.detailInfo.trackData.timestamp | double | 7.9 | The timestamp. |
| hotwords | JSONArray | - | - |
| hotwords.labelLevel1 | String | Keyword | The level-1 tag. |
| hotwords.labelLevel1 | String | Keyword | The level-2 tag. |
| hotwords.labelLevel2 | String | "" | The level-2 tag. |
| hotwords.label | String | China Meteorological Administration | The content of the highlight word. |
| hotwords.appearanceProbability | double | 0.96 | The appearance rate. |
| hotwords.detailInfo | JSONArray | ||
| hotwords.detailInfo.score | double | 1.0 | The confidence score. |
| hotwords.detailInfo.startTime | double | 0.021 | The start time. |
| hotwords.detailInfo.endTime | double | 29.021 | The end time. |
| freeTags | JSONArray | ||
| freeTags.labelLevel1 | String | Keyword | The level-1 tag. |
| freeTags.labelLevel2 | String | "" | The level-2 tag. |
| freeTags.label | String | National Meteorological Center | The content of the highlight word. |
| freeTags.appearanceProbability | double | 0.96 | The appearance rate. |
| freeTags.detailInfo | JSONArray | ||
| freeTags.detailInfo.score | double | 0.9 | The confidence score. |
| freeTags.detailInfo.startTime | double | 0.021 | The start time. |
| freeTags.detailInfo.endTime | double | 29.021 | The end time. |
Speech recognition ASR results
| Name | Type | Description |
| details | JSONArray | The detailed results of the job. |
| details.from | double | The start timestamp, in seconds. |
| details.to | double | The end timestamp, in seconds. |
| details.content | String | The recognized text content. |
OCR results
| Name | Type | Description |
| details | JSONArray | The detailed results of the job. |
| details.timestamp | double | The timestamp information, in seconds. |
| details.info | JSONArray | The specific information recognized at the timestamp. |
| details.info.score | double | The confidence score. |
| details.info.position | JSONObject | The text coordinates. |
| details.info.position.leftTop | int[] | The x and y coordinates of the upper-left corner. |
| details.info.position.rightBottom | int[] | The x and y coordinates of the lower-right corner. |
| details.info.content | String | The recognized text content. |
| details.info.textType | String | The text type. Valid values: 0 (normal subtitles), 1 (scrolling subtitles), and 2 (fixed-length identifying subtitles that last for more than 3 seconds). |
Meta tagging results
If you do not use human-machine tagging and specify the needMetaData parameter when calling the SubmitSmarttagJob operation to submit a job, the QuerySmarttagJob operation currently returns the original title entered by the user in the response.
| Name | Type | Description |
| title | String | The title. |
Subtitle extraction results
| Name | Type | Description |
| details | JSONArray | The detailed results of the job. |
| details.allResultUrl | String | The URL of all subtitle results. The URL is valid for half a year after the job is completed. |
| details.chResultUrl | String | The URL of the Chinese results. The URL is valid for half a year after the job is completed. |
| details.engResultUrl | String | The URL of the English results. The URL is valid for half a year after the job is completed. |
Subtitle result URL content: Sequence number + Time period + Subtitle content (each subtitle sentence is on a separate line).
Examples
Success response
JSON format
{
"JobStatus": "Success",
"Message": "Job Success!",
"RequestId": "7B117AF5-2A16-412C-B127-FA6175ED1AD0",
"Results": {
"Result": [
{
"Data": "{\"title\":\"example-title-****\"}",
"Type": "Meta"
}
]
},
"UserData": "example UserData ****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.