SubmitVideoAnalysisTask

Updated at:

Alibaba Cloud Model Studio mini app: Submit an offline asynchronous task for video understanding.

Operation description

Asynchronous tasks

Unlike synchronous APIs, this API returns a response immediately after you submit an asynchronous task. The system schedules background tasks using a queuing mechanism and parallel processing. You can check the task status and retrieve the results by calling the "Get asynchronous task status and results" API.

API calls

Concurrency

ItemDescription
Default concurrency2. This is the concurrency limit for running asynchronous tasks, not for API calls.
Adjustable upper limitYou can increase the limit to 30 by calling the UpdateVideoAnalysisConfig API.
Higher concurrencyIf your business requires higher throughput, contact support to request a limit increase.
Queuing mechanismThis limit defines the number of tasks that can run simultaneously. Tasks submitted beyond this limit are automatically queued.

Role recognition

  • Use the API to identify people in a video.
  • Default recognition limit: Up to 16 people, with one image per role.
  • Increase the limit: To request a higher limit, join the DingTalk group with ID 116015001424 and contact the product R&D team.
  • Timeout risk: Too many role-matching operations in a single video analysis task can increase the risk of a timeout.

Scheduling and polling best practices

Because API call concurrency is limited, we recommend the following:

  • Concurrency scaling: The adjustable concurrency limit applies to the number of asynchronous tasks processed simultaneously, not the task submission rate.
  • Task submission: Typically, submitting tasks serially is sufficient. If you have a large number of tasks, you can submit them with a concurrency of 2 to 3.
  • Polling for results: Tasks are processed in the order they are submitted. Therefore, only poll for the status of the N oldest incomplete tasks, where N equals your asynchronous task concurrency limit. Polling for other tasks is inefficient because they are still in the queue.

Agent integration

Agents can use video analysis capabilities directly through a Skill:

Try it now

You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After the call succeeds, OpenAPI Explorer can automatically generate SDK code examples.

RAM authorization

The following table describes the authorization information for this API. You can use the Action element in RAM permission policy statements to grant RAM users or RAM roles the permission to call this API. Details are as follows:

  • Action: refers to the specific permission point.

  • Access level: refers to the access level of each operation. Valid values: Write, Read, and List.

  • Resource type: refers to the resource types that support authorization for the operation. Details are as follows:

    • For required resource types, an asterisk (*) is added before them.
    • For operations that do not support resource-level authorization, All resources is used.
  • Condition key: refers to the condition keys defined by the cloud service itself.

  • Dependent action: refers to other permissions required to successfully perform the operation. The caller must have the permissions of all dependent actions for the operation to succeed.

Action

Access level

Resource type

Condition key

Dependent action

quanmiaolightapp:SubmitVideoAnalysisTask

create

*All Resource

*

NoneNone

Request syntax

POST /{workspaceId}/quanmiao/lightapp/videoAnalysis/submitVideoAnalysisTask HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

workspaceId

string

Yes

The workspace ID in Alibaba Cloud Model Studio. Get workspaceId

llm-xxx

Request parameters

Parameter

Type

Required

Description

Example

videoUrl

string

No

The video URL.

http://xxxx.mp4

videoModelId

string

No

The unique identifier for the model used in the video vision-language (VL) task. Supported models:

  • quanmiao-vl-turbo

  • quanmiao-vl-plus

  • quanmiao-vl-max-thinking

  • quanmiao-vl-max

  • Qwen-VL-Post

quanmiao-vl-turbo

videoModelCustomPromptTemplate

string

No

The prompt template for the video vision-language (VL) task. This template must include the {videoAsrText} variable, which represents the Automatic Speech Recognition (ASR) text from the video. If this parameter is not specified, the default value displayed on the page is used.

# Role You are a video analyst skilled at understanding various video segments. # Task description You are given multiple keyframe images of a video segment. Please complete the following tasks. - Output the visual information of each image, including people, objects, actions, text, subtitles, camera language, and so on. - Connect the information of each image to generate a detailed overview of the video and reconstruct the plot of this segment. # Limitations - The analysis scope is strictly limited to the provided video sub-segment and does not involve any speculation or background information beyond the video. - The summary must strictly follow the video content and must not add personal speculation or creative content. - Maintain high-fidelity reproduction of all video elements (especially text and subtitles) to avoid information omission or misunderstanding. # Input data ## Video segment ASR information (if the input is empty, ignore the ASR information) {videoAsrText} # Output format Just follow the task objectives. Output the description of each image first, then connect them to output the plot of the entire video segment.

modelId

string

No

The unique identifier for the large model used for video summarization (text processing).

To run multiple text processing tasks, use the textProcessTasks parameter. If textProcessTasks is specified, the system ignores this parameter, modelCustomPromptTemplateId, and modelCustomPromptTemplate.

  • quanmiao-llm-max

  • quanmiao-llm-max-thinking

  • quanmiao-llm-plus

  • quanmiao-llm-turbo

quanmiao-llm-max

modelCustomPromptTemplateId

string

No

The ID of the prompt template for video summarization. Valid values:

  • PlotDetail: Detailed plot analysis (default).

  • Summary: Content summary.

  • ExtractVideoTag: Tag extraction.

  • ExplosivePointAnalysis: Viral content analysis.

  • MultiTask: Multiple tasks.

The modelCustomPromptTemplate parameter takes precedence over this parameter. If only an ID is provided, the system uses the default prompt associated with that ID.

PlotDetail

modelCustomPromptTemplate

string

No

A custom prompt template for the large model used for video summarization. The template must include both the {videoAsrText} and {videoAnalysisText} variables. {videoAsrText} represents the ASR text from the video, and {videoAnalysisText} represents the vision-language (VL) analysis results for each shot in the video.

# Role You are a professional video annotator skilled at analyzing and processing various video tasks by combining video shot information. # Task objective Please connect and reconstruct the detailed plot of the entire video based on the input data. # Limitations 1. If there are grammatical errors or logical inconsistencies, modify them directly. 2. In video shots that contain dialogue, the speaker may not match the content being said. Therefore, you must accurately determine the true speaker of each line of dialogue based on the progression of the plot. 3. If there is no dialogue in the video shots, match the dialogue based on the video audio text. 4. The modified story should appropriately retain the descriptions of people and scenes in the video shots. 5. Please polish the story to make it more logical. 6. Based on the appearance characteristics of people in the video shots, people with similar appearances are the same character. Therefore, the character roles across different shots need to be unified. # Input data ## Material 1: Video shot information (visual description information of each shot of the video) {videoAnalysisText} ## Material 2: Video ASR transcript information (the speaker is not annotated, and there may be errors and omissions; if no ASR is input, ignore this information) {videoAsrText} # Output format Output the video plot directly and do not output other information.

generateOptions

array

No

The video understanding tasks to perform.

string

No

The video understanding task to perform. Prerequisite tasks are executed automatically.

  • videoAnalysis: Vision-language analysis (VL). If this is the only option provided, the process stops after this analysis and performs no subsequent subtasks.

  • videoGenerate: Text processing and video summarization (default). This includes videoAnalysis.

  • videoTitleGenerate: Video title generation. This includes videoAnalysis and videoGenerate.

  • videoMindMappingGenerate: Video mind map generation. This includes videoAnalysis and videoGenerate; videoRoleRecognition: Automatic character recognition.

videoGenerate

videoExtraInfo

string

No

Supplementary text about the video, such as a summary, description, or ASR transcript. To use this text, you must include the {videoExtraInfo} variable in the prompt template.

The video describes: xx

snapshotInterval

number

No

The frame sampling interval, in seconds. The value must be between 1 and 10, inclusive. A larger interval means fewer frames are extracted, which can reduce accuracy but also decrease processing time and cost. The default setting is optimized and recommended for most use cases. If you adjust it, a value between 1 and 3 is recommended. Note: This parameter has a higher priority than frameSampleMethod.interval. For typical scenarios, you can use the interval parameter within the userdefined mode of the frameSampleMethod object. The key difference is that the interval in frameSampleMethod's custom mode must be within a specific range corresponding to the video's duration.

2

splitInterval

integer

No

The minimum shot split interval, in seconds. The value must be an integer between 1 and 150, inclusive. If not specified, the system calculates an optimal interval based on the video's duration.

10

language

string

No

The language of the video. Valid values:

  • chinese: Chinese (default)

  • french: French

  • english: English

  • japanese: Japanese

  • chineseEnglishFreely: Mixed Chinese and English

  • arabic: Arabic

  • korean: Korean

  • malay: Malay

  • thai: Thai

  • portuguese: Portuguese

  • spanish: Spanish

  • indonesian: Indonesian

  • vietnamese: Vietnamese

chinese

frameSampleMethod

object

No

The frame sampling method.

english

methodName

string

No

The sampling method. Valid values:

  • fast: Fast/lower cost

  • standard: Standard (default)

  • userdefined: Custom

standard

interval

number

No

The frame sampling interval in seconds. This parameter is valid only when methodName is set to userdefined.

2

pixel

integer

No

The maximum pixel length of the longest side of each sampled frame. This parameter is valid only when methodName is set to userdefined. The value must be between 300 and 768, inclusive.

768

videoRoles

array<object>

No

A list of characters to recognize in the video.

array<object>

No

A character to be recognized in the video.

roleName

string

No

The character's name.

John Doe

roleInfo

string

No

A description of the character.

John Doe is a male

urls

array

No

A list of URLs for the character's avatar images.

string

No

The URL of a character avatar image.

http://xxx

isAutoRecognition

boolean

No

Specifies whether to use a separate video URL for automatic recognition. If true, the timestamps of face images may not align with the main video frames, as they can come from different videos.

false

timeIntervals

array<object>

No

A list of time intervals for the character's appearances.

object

No

startTime

integer

No

The start time.

0

endTime

integer

No

The end time.

345546789

textProcessTasks

array<object>

No

A list of video summarization (text processing) tasks. You can specify up to three tasks.

object

No

A video summarization (text processing) task.

modelId

string

No

The ID of the large model for video summarization. Supported models:

  • qwen-max-latest

  • qwen-max

  • qwen-plus-latest

  • qwen-plus

  • qwen2.5-7b-instruct-1m

qwen-max-latest

modelCustomPromptTemplate

string

No

A custom prompt template for the large model used for video summarization. The template must include both the {videoAsrText} and {videoAnalysisText} variables. {videoAsrText} represents the ASR text from the video, and {videoAnalysisText} represents the vision-language (VL) analysis results for each shot in the video.

xx

modelCustomPromptTemplateId

string

No

The ID of the prompt template for video summarization. Valid values:

  • PlotDetail: Detailed plot analysis (default).

  • Summary: Content summary.

  • ExtractVideoTag: Tag extraction.

  • ExplosivePointAnalysis: Viral content analysis.

  • MultiTask: Multiple tasks.

The modelCustomPromptTemplate parameter takes precedence over this parameter. If only an ID is provided, the system uses the default prompt associated with that ID.

PlotDetail

faceIdentitySimilarityMinScore

number

No

The similarity threshold for character recognition. The value must be between 0 and 1, inclusive.

0.7

videoShotFaceIdentityCount

integer

No

The number of frames (images) per shot to be used for character matching. The value must be an integer between 1 and 5, inclusive.

2

deduplicationId

string

No

A custom unique identifier for request deduplication. The system rejects requests that have the same deduplicationId as a request submitted within the last 72 hours.

1

excludeGenerateOptions

array

No

Steps to exclude from the generation process.

  • videoCaption: Video speech recognition (ASR)

string

No

A step to exclude from the generation process.

  • videoCaption: Video speech recognition (ASR)

[\"videoCaption\"]

videoCaptionInfo

object

No

Information about the captions (ASR).

videoCaptions

array<object>

No

An array of caption objects. You must provide either this parameter or videoCaptionsFileUrl.

object

No

A caption object that contains the text, speaker, and timestamp for a segment.

startTime

integer

No

The start time of the current sentence, in milliseconds.

1000

endTime

integer

No

The end time of the current sentence, in milliseconds.

10000

text

string

No

The content.

Hello

speaker

string

No

The character who is speaking.

John Doe

videoCaptionFileUrl

string

No

The video caption (ASR) file.

oss:// | http://

autoRoleRecognitionVideoUrl

string

No

A separate video URL to use for automatic character recognition.

http://

splitType

string

No

The shot split method. Valid values are minDuration (ensures each shot meets a minimum duration) and fixDuration (splits the video into fixed-duration shots). Default: minDuration.

fixDuration

addDocumentParam

object

No

Parameters for uploading the video and its analysis results as metadata to a Miaosou dataset.

datasetId

integer

No

The ID of the Miaosou dataset. This parameter is required to upload the results.

3031

datasetName

string

No

The dataset name.

xxx

document

object

No

Parameters for uploading to Miaosou. If not provided, they are generated automatically.

title

string

No

The video name.

xx

docId

string

No

A unique business identifier for the document, used for deduplication within the specified dataset.

xxx

categoryUuid

string

No

The unique identifier for the document category.

xx

tags

array

No

An array of tags.

string

No

A tag.

xx

extend1

string

No

Extended field 1.

xx

extend2

string

No

Extended field 2.

xx

extend3

string

No

Extended field 3.

xx

metadata

object

No

The metadata.

keyValues

array<object>

No

Metadata in a key-value structure.

object

No

Metadata in a key-value structure.

key

string

No

The field name.

summary

value

string

No

The field value.

xxx

videoUrls

array

No

A list of video URLs. The videos are concatenated and processed as a single video. This feature is suitable for short video clips.

string

No

A video URL.

xxx

Response elements

Element

Type

Description

Example

object

Schema of Response

requestId

string

The ID of the request.

085BE2D2-BB7E-59A6-B688-F2CB32124E7F

success

boolean

Indicates whether the request is successful. true indicates success and false indicates failure.

True

code

string

The status code.

xx

message

string

The error description.

success

httpStatusCode

integer

The HTTP status code.

200

data

object

The returned data.

taskId

string

The task ID.

3feb69ed02d9b1a17d0f1a942675d300

Examples

Success response

JSON format

{
  "requestId": "085BE2D2-BB7E-59A6-B688-F2CB32124E7F",
  "success": true,
  "code": "xx",
  "message": "success",
  "httpStatusCode": 200,
  "data": {
    "taskId": "3feb69ed02d9b1a17d0f1a942675d300"
  }
}

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.Check the assignment of the workspaceId.

Visit Error Center to view more error codes.

Release notes

See Release Notes for a complete list.