GetVideoAnalysisTask

Updated at:

Light application – retrieve the result of an asynchronous video understanding task.

Operation description

Alibaba Cloud Model Studio light application – video understanding – get the status and result of an asynchronous task. Use this API to check the status and result of a video understanding task submitted via the “Submit asynchronous task” API. Try it in the Video Understanding console.

NoteIf the response includes header -> errorCode = ViolationOfSecurityPolicy, the request triggered a system security policy restriction. Modify the request content accordingly. In this case, business data such as videoAnalysisResult returns empty.

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.

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

quanmiaolightapp:GetVideoAnalysisTask

get

*All Resource

*

NoneNone

Request syntax

GET /{workspaceId}/quanmiao/lightapp/videoAnalysis/getVideoAnalysisTask HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

workspaceId

string

Yes

Unique identifier of the Alibaba Cloud Model Studio workspace: Get workspaceId

llm-xxxx

Request parameters

Parameter

Type

Required

Description

Example

taskId

string

Yes

Unique task identifier

a3d1c2ac-f086-4a21-9069-f5631542f5a2

Response elements

Element

Type

Description

Example

object

Schema of Response

requestId

string

Id of the request

5D0E915E-655D-59A8-894F-93873F73AAE5

code

string

Status code

successful

message

string

Error message

success

httpStatusCode

integer

HTTP status code

200

success

boolean

Indicates whether the operation succeeded: true for success, false for failure

True

data

object

Result

header

object

Event name

errorCode

string

Error code

success

errorMessage

string

Error message

Deduct task already success,Please do not resubmit.token '369e8f2c-d283-424a-96c4-c83efe08c89e'

event

string

Event type

TIMEOUT_CLOSE_ORDER

eventInfo

string

Event description

xxx

sessionId

string

Unique session identifier

d5c38cf6-a4bf-4a57-a697-9f449926f0c9

taskId

string

Unique generation identifier

6e223291-729b-4e84-9271-c13ada1a776b

traceId

string

Trace ID

215045f817272303448235204efdef

payload

object

Result

output

object

Result

videoAnalysisResult

object

Generated content from language analysis

generateFinished

boolean

Indicates whether the current task has finished generating

true

text

string

VL-generated text result

xxx

usage

object

Token count

inputTokens

integer

Number of input tokens

0

outputTokens

integer

Number of output tokens

0

totalTokens

integer

Total number of tokens

0

imageTokens

integer

Image tokens

1

videoShotAnalysisResults

array<object>

Language analysis results for each video shot. Due to large content size, obtain this data from the file at resultJsonFileUrl.

object

Video shot result

endTime

integer

End time in relative time (milliseconds)

10000

startTime

integer

Start time in relative time (milliseconds)

1000

text

string

Generated raw content

xxxx

videoCaptionResult

object

Video captions

generateFinished

boolean

Indicates whether the current task has finished generating

true

videoCaptions

array<object>

Video captions

object

Video captions

endTime

integer

End time in relative time (milliseconds)

20000

endTimeFormat

string

Formatted end time

00:01

startTime

integer

Start time in relative time (milliseconds)

1000

startTimeFormat

string

Formatted start time

00:01

text

string

Caption content

xxxx

speaker

string

Role

Zhang San

videoGenerateResult

object

Text summarization result. For multitasking, get results from the videoGenerateResults field.

generateFinished

boolean

Indicates whether the current task has finished generating

true

text

string

Generated text

xxx

usage

object

Output token count

inputTokens

integer

Number of input tokens

1

outputTokens

integer

Number of output tokens

1

totalTokens

integer

Total number of tokens

2

modelId

string

Model ID

qwen-max-latest

modelReduce

boolean

Indicates whether the model was downgraded. If the model is qwen-max or qwen-max-latest and exceeds the prompt input limit, it attempts to downgrade to qwen-plus-latest to preserve information integrity.

qwen-plus-latest

reasonText

string

Model reasoning process

xx

index

integer

Multitask index starting from 1

1

videoMindMappingGenerateResult

object

Mind map generation complete

generateFinished

boolean

Indicates whether the current task has finished generating

true

text

string

Generated text

Snack Street

usage

object

Input token count

inputTokens

integer

Number of input tokens

1

outputTokens

integer

Number of output tokens

1

totalTokens

integer

Total number of tokens

2

videoMindMappings

array<object>

Mind map results

array<object>

Child node

childNodes

array<object>

Child node

array<object>

Child node

childNodes

array<object>

Child node

object

Node description

name

string

Node description

Level 3 node

name

string

Node description

Level 2 node

name

string

Node description

Level 3 node

videoTitleGenerateResult

object

Title generation result

generateFinished

boolean

Indicates whether the current task has finished generating

true

text

string

Text generation result

xxxx

usage

object

Token count

inputTokens

integer

Number of input tokens

0

outputTokens

integer

Number of output tokens

0

totalTokens

integer

Total number of tokens

0

resultJsonFileUrl

string

Result JSON file URL:

Due to large response size, some data is provided via file download. Use the URL in this field to download and parse the file:

  • Fields included: See data structure definition in RunVideoAnalysis API
    • videoShotSnapshotResult: Frame extraction info for each shard, including frame URLs

    • videoShotAnalysisResults: Detailed language analysis results for each shard

  • Other fields remain unchanged and are returned as text.

  • File type: JSON

  • File content: Full message body, including text-based responses with event: task-finished

http://xxx

videoGenerateResults

array<object>

When input parameters include multitasking (textProcessTasks has a value), text processing results are returned in this field. Locate the corresponding result by array index (starting from 0) or by index (starting from 1).

array<object>

Text processing task result

generateFinished

boolean

Indicates whether the current task has finished generating

true

modelId

string

Model ID

xx

index

integer

Multitask index starting from 1

1

text

string

Generated content

xx

reasonText

string

Model reasoning process

xx

usage

object

Usage

inputTokens

integer

Number of input tokens

1

outputTokens

integer

Number of output tokens

1

totalTokens

integer

Total tokens

2

videoRoleRecognitionResult

object

Automatic recognition result

videoRoles

array<object>

List of roles

array<object>

roleName

string

Role name

xx

roleInfo

string

Character information

xx

timeIntervals

array<object>

List of role appearance time intervals

object

startTime

integer

Start time

0

endTime

integer

End time

342463553646

timestamp

integer

Timestamp of role appearance in current time interval

42553453253

url

string

Role image

http://

ratio

number

Appearance rate

0.2

isAutoRecognition

boolean

Indicates whether automatic recognition used a separate video URL. If true, face images cannot be matched to video frames by timestamp because they may come from different videos.

videoCalculatorResult

object

Cost estimation result

items

array<object>

Billing item details

object

Billing item details

name

string

Billing item name

xxx

type

string

Type

token

inputToken

integer

Input tokens

1

outputToken

integer

Output tokens

1

time

integer

Billed duration

1

inputExpense

number

Input token billing

1

outputExpense

number

Input token billing

1

timeExpense

number

Output token billing

1

totalExpense

number

Cost

0.098

addDatasetDocumentsResult

object

Automatic save execution result

status

integer

Automatic save task status: 1 for success, 0 for failure

1

title

string

Video title

xx

docId

string

Video docId

xxx

errorMessage

string

If automatic saving fails, this field contains the error message.

xx

docUuid

string

Video docUuid

xxx

usage

object

Token description

inputTokens

integer

Number of input tokens

0

outputTokens

integer

Number of output tokens

0

totalTokens

integer

Total number of tokens

0

taskRunInfo

object

Runtime information

concurrentChargeEnable

boolean

Indicates whether paid concurrency is used. When true, billing is based on actual runtime duration.

true

responseTime

integer

Runtime duration: Time elapsed from task scheduling to completion, in milliseconds

1000

taskStatus

string

Task status.

  • PENDING: Pending

  • RUNNING: Running

  • SUCCESSED: Succeeded

  • SUSPENDED: Suspended

  • FAILED: Failed

  • CANCELED: Canceled

SUCCESSED

taskId

string

Task ID

3feb69ed02d9b1a17d0f1a942675d300

errorMessage

string

Error message

Access was denied, message: No such namespace namespaces/mjp-test-default.

Examples

Success response

JSON format

{
  "requestId": "5D0E915E-655D-59A8-894F-93873F73AAE5",
  "code": "successful",
  "message": "success",
  "httpStatusCode": 200,
  "success": true,
  "data": {
    "header": {
      "errorCode": "success",
      "errorMessage": "Deduct task already success,Please do not resubmit.token '369e8f2c-d283-424a-96c4-c83efe08c89e'",
      "event": "TIMEOUT_CLOSE_ORDER",
      "eventInfo": "xxx",
      "sessionId": "d5c38cf6-a4bf-4a57-a697-9f449926f0c9",
      "taskId": "6e223291-729b-4e84-9271-c13ada1a776b",
      "traceId": "215045f817272303448235204efdef"
    },
    "payload": {
      "output": {
        "videoAnalysisResult": {
          "generateFinished": true,
          "text": "xxx",
          "usage": {
            "inputTokens": 0,
            "outputTokens": 0,
            "totalTokens": 0,
            "imageTokens": 1
          },
          "videoShotAnalysisResults": [
            {
              "endTime": 10000,
              "startTime": 1000,
              "text": "xxxx"
            }
          ]
        },
        "videoCaptionResult": {
          "generateFinished": true,
          "videoCaptions": [
            {
              "endTime": 20000,
              "endTimeFormat": "00:01",
              "startTime": 1000,
              "startTimeFormat": "00:01",
              "text": "xxxx",
              "speaker": "张三"
            }
          ]
        },
        "videoGenerateResult": {
          "generateFinished": true,
          "text": "xxx",
          "usage": {
            "inputTokens": 1,
            "outputTokens": 1,
            "totalTokens": 2
          },
          "modelId": "qwen-max-latest",
          "modelReduce": true,
          "reasonText": "xx",
          "index": 1
        },
        "videoMindMappingGenerateResult": {
          "generateFinished": true,
          "text": "小吃街",
          "usage": {
            "inputTokens": 1,
            "outputTokens": 1,
            "totalTokens": 2
          },
          "videoMindMappings": [
            {
              "childNodes": [
                {
                  "childNodes": [
                    {
                      "name": "三级节点"
                    }
                  ],
                  "name": "二级节点"
                }
              ],
              "name": "三级节点"
            }
          ]
        },
        "videoTitleGenerateResult": {
          "generateFinished": true,
          "text": "xxxx",
          "usage": {
            "inputTokens": 0,
            "outputTokens": 0,
            "totalTokens": 0
          }
        },
        "resultJsonFileUrl": "http://xxx",
        "videoGenerateResults": [
          {
            "generateFinished": true,
            "modelId": "xx",
            "index": 1,
            "text": "xx",
            "reasonText": "xx",
            "usage": {
              "inputTokens": 1,
              "outputTokens": 1,
              "totalTokens": 2
            }
          }
        ],
        "videoRoleRecognitionResult": {
          "videoRoles": [
            {
              "roleName": "xx",
              "roleInfo": "xx",
              "timeIntervals": [
                {
                  "startTime": 0,
                  "endTime": 342463553646,
                  "timestamp": 42553453253,
                  "url": "http://"
                }
              ],
              "ratio": 0.2,
              "isAutoRecognition": false
            }
          ]
        },
        "videoCalculatorResult": {
          "items": [
            {
              "name": "xxx",
              "type": "token",
              "inputToken": 1,
              "outputToken": 1,
              "time": 1,
              "inputExpense": 1,
              "outputExpense": 1,
              "timeExpense": 1,
              "totalExpense": 0.098
            }
          ]
        },
        "addDatasetDocumentsResult": {
          "status": 1,
          "title": "xx",
          "docId": "xxx",
          "errorMessage": "xx",
          "docUuid": "xxx"
        }
      },
      "usage": {
        "inputTokens": 0,
        "outputTokens": 0,
        "totalTokens": 0
      }
    },
    "taskRunInfo": {
      "concurrentChargeEnable": true,
      "responseTime": 1000
    },
    "taskStatus": "SUCCESSED",
    "taskId": "3feb69ed02d9b1a17d0f1a942675d300",
    "errorMessage": "Access was denied, message: No such namespace namespaces/mjp-test-default."
  }
}

Error codes

HTTP status code

Error code

Error message

Description

403NoPermissionYou are not authorized to perform this action , Please check the assignment of the workspaceId.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.