QuerySmarttagJob

Updated at:

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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"}. The labelResultType parameter is of the String type. Valid values:

  • auto: machine tagging results.

  • hmi: human-machine collaboration results.

{"labelResultType":"auto"}

Response elements

Element

Type

Description

Example

object

The response parameters.

JobStatus

string

The status of the job. Valid values:

  • Success: The job succeeded.

  • Fail: The job failed.

  • Processing: The job is being processed.

  • Submitted: The job is submitted and pending processing.

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.

  • Smart Tag 1.0 analysis result types:

    • TextLabel: text tags.

    • VideoLabel: video tags.

    • ASR: original automatic speech recognition (ASR) results. By default, this is not returned.

    • OCR: original optical character recognition (OCR) results. By default, this is not returned.

    • Process: the URL of the JSON file for the original algorithm results. By default, this is not returned. For the JSON structure, see Supplementary notes.

  • Smart Tag 2.0 analysis result types:

    • CPVLabel: human-machine collaboration.

    • Meta: information such as the video title. By default, this is not returned.

  • Smart Tag 2.0-custom analysis result types:

    • CPVLabel: human-machine collaboration.

    • Meta: information such as the video title. By default, this is not returned.

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:

NameTypeDescription
TypeStringThe fixed string "smarttag", which indicates a smart tag job.
JobIdStringThe unique ID of the job.
StateStringThe current status of the job, which is the same as the JobStatus parameter in QuerySmarttagJob.
UserDataStringThe UserData parameter passed by the user in SubmitSmarttagJob.

Result parameter description

VideoLabel data structure.

NameTypeDescription
personsJSONArrayThe detected figure results.
persons.nameStringThe name of the recognized figure.
persons.categoryStringThe 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.ratiodoubleThe appearance rate of the figure. Valid values: 0 to 1.
persons.occurrencesJSONArrayThe details of the figure's appearances.
persons.occurrences.scoredoubleThe confidence score.
persons.occurrences.fromdoubleThe start time when the figure is detected, in seconds.
persons.occurrences.todoubleThe end time when the figure is detected, in seconds.
persons.occurrences.positionJSONObjectThe face coordinates.
persons.occurrences.position.leftTopint[]The x and y coordinates of the upper-left corner.
persons.occurrences.position.rightBottomint[]The x and y coordinates of the lower-right corner.
persons.occurrences.timestampdoubleThe timestamp of the face coordinates, in seconds.
persons.occurrences.sceneStringThe figure shot type. Valid values: closeUp (close-up), medium-closeUp (medium close-up), medium (medium shot), and medium-long (full shot).
tagsJSONArrayThe detected tags for objects and scenes. For examples, see the following table.
tags.mainTagNameStringThe main tag.
tags.subTagNameStringThe sub-tag.
tags.ratiodoubleThe appearance rate. Valid values: 0 to 1.
tags.occurrencesJSONArrayThe details of the appearances.
tags.occurrences.scoredoubleThe confidence score.
tags.occurrences.fromdoubleThe start time, in seconds.
tags.occurrences.todoubleThe end time, in seconds.
classificationsJSONArrayThe video classification information.
classifications.scoredoubleThe confidence score.
classifications.category1StringThe level-1 category, such as life, anime, and automobile.
classifications.category2StringThe level-2 category. For example, the life category can be subdivided into health and home.

Examples of video tags.

mainTagNamesubTagName
ProgramExamples: Where Are We Going, Dad?, Super Comedian
Character roleExamples: doctor, nurse, and teacher
ObjectExamples: piano, water cup, desk, scrambled eggs with tomatoes, car, and cosmetics
LogoExamples: CCTV1, CCTV2, Youku, and Dragon TV
Action eventExamples: dancing, kissing, hugging, meeting, singing, making a phone call, horse riding, and fighting
RegionExamples: Tiananmen Square in Beijing, Statue of Liberty, Leshan Giant Buddha, China, and United States
SceneExamples: bedroom, subway station, terraced field, beach, and desert

ImageLabel data structure.

NameTypeDescription
personsJSONArrayThe detected figure results.
persons.nameStringThe name of the recognized figure.
persons.categoryStringThe figure type. Valid values: celebrity (celebrity), politician (politician), and sensitive (sensitive figure).
persons.scoredoubleThe confidence score of the figure.
persons.positionJSONObjectThe face coordinates.
persons.position.leftTopint[]The x and y coordinates of the upper-left corner.
persons.position.rightBottomint[]The x and y coordinates of the lower-right corner.
persons.sceneStringThe figure shot type. Valid values: closeUp (close-up), medium-closeUp (medium close-up), medium (medium shot), and medium-long (full shot).
tagsJSONArrayThe detected tags for objects and scenes. For examples, see the following table.
tags.mainTagNameStringThe main tag.
tags.subTagNameStringThe sub-tag.
tags.scoredoubleThe confidence score.

Examples of image tags.

mainTagNamesubTagName
Character roleExamples: doctor, nurse, and teacher
RegionExamples: Tiananmen Square in Beijing, Statue of Liberty, Leshan Giant Buddha, China, and United States
Action eventExamples: speaking
LogoExamples: CCTV1, CCTV2, Youku, and Dragon TV
Action eventExamples: dancing, kissing, hugging, meeting, singing, making a phone call, horse riding, and fighting
ObjectExamples: piano, water cup, desk, scrambled eggs with tomatoes, car, and cosmetics
SceneExamples: bedroom, subway station, terraced field, beach, and desert

TextLabel data structure (derived from ASR and OCR)

NameTypeDescription
tagsJSONArrayThe text tag information. For examples, see the following table.
tags.nameStringThe tag category.
tags.valueStringThe tag values. Multiple tag values are separated by commas (,).

Examples of text tags.

namevalue
RegionExamples: Tiananmen Square in Beijing, Statue of Liberty, Leshan Giant Buddha, China, and United States
OrganizationExamples: China Wildlife Conservation Association and China Media Group
LogoExamples: Nike and Li-Ning
KeywordExamples: 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).

NameTypeExampleDescription
typeStringhmiThe result type. Valid values: hmi (human-machine collaboration results) and autp (machine tagging results).
catesJSONArray-The classification category results.
cates.labelLevel1StringTourismThe level-1 tag.
cates.labelLevel2StringTourism sceneryThe level-2 tag.
cates.labelString""The tag name. The algorithm may return an empty string.
cates.appearanceProbabilitydouble0.96The appearance rate.
cates.detailInfoJSONArray--
cates.detailInfo.scoredouble0.9The confidence score.
cates.detailInfo.startTimedouble0.021The start time.
cates.detailInfo.endTimedouble29.021The end time.
entitiesJSONArray--
entities.labelLevel1StringRegionThe level-1 tag.
entities.labelLevel2StringLandmarkThe level-2 tag.
entities.labelStringHuangguoshu WaterfallThe tag name.
entities.appearanceProbabilitydouble0.067The appearance rate.
entities.knowledgeInfoString{"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.detailInfoJSONArray--
entities.detailInfo.scoredouble0.33292606472969055The confidence score.
entities.detailInfo.startTimedouble6.021The start time.
entities.detailInfo.endTimedouble8.021The end time.
entities.detailInfo.trackDataJSONArray-The structured information of the entity tag.
entities.detailInfo.trackData.scoredouble0.32The confidence score.
entities.detailInfo.trackData.bboxinteger[]23, 43, 45, 67The bounding box coordinates.
entities.detailInfo.trackData.timestampdouble7.9The timestamp.
hotwordsJSONArray--
hotwords.labelLevel1StringKeywordThe level-1 tag.
hotwords.labelLevel1StringKeywordThe level-2 tag.
hotwords.labelLevel2String""The level-2 tag.
hotwords.labelStringChina Meteorological AdministrationThe content of the highlight word.
hotwords.appearanceProbabilitydouble0.96The appearance rate.
hotwords.detailInfoJSONArray
hotwords.detailInfo.scoredouble1.0The confidence score.
hotwords.detailInfo.startTimedouble0.021The start time.
hotwords.detailInfo.endTimedouble29.021The end time.
freeTagsJSONArray
freeTags.labelLevel1StringKeywordThe level-1 tag.
freeTags.labelLevel2String""The level-2 tag.
freeTags.labelStringNational Meteorological CenterThe content of the highlight word.
freeTags.appearanceProbabilitydouble0.96The appearance rate.
freeTags.detailInfoJSONArray
freeTags.detailInfo.scoredouble0.9The confidence score.
freeTags.detailInfo.startTimedouble0.021The start time.
freeTags.detailInfo.endTimedouble29.021The end time.

Speech recognition ASR results

NameTypeDescription
detailsJSONArrayThe detailed results of the job.
details.fromdoubleThe start timestamp, in seconds.
details.todoubleThe end timestamp, in seconds.
details.contentStringThe recognized text content.

OCR results

NameTypeDescription
detailsJSONArrayThe detailed results of the job.
details.timestampdoubleThe timestamp information, in seconds.
details.infoJSONArrayThe specific information recognized at the timestamp.
details.info.scoredoubleThe confidence score.
details.info.positionJSONObjectThe text coordinates.
details.info.position.leftTopint[]The x and y coordinates of the upper-left corner.
details.info.position.rightBottomint[]The x and y coordinates of the lower-right corner.
details.info.contentStringThe recognized text content.
details.info.textTypeStringThe 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

Note

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.

NameTypeDescription
titleStringThe title.

Subtitle extraction results

NameTypeDescription
detailsJSONArrayThe detailed results of the job.
details.allResultUrlStringThe URL of all subtitle results. The URL is valid for half a year after the job is completed.
details.chResultUrlStringThe URL of the Chinese results. The URL is valid for half a year after the job is completed.
details.engResultUrlStringThe URL of the English results. The URL is valid for half a year after the job is completed.
Note

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.