SubmitVideoAnalysisTask
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
- You can call the API by using SDKs for most major programming languages.
- You can debug and use the API directly in OpenAPI Explorer.
- You can also go to the Model Studio - Film and Television Media Video Analysis Console, switch to the API tab, and view a call demo.
Concurrency
| Item | Description |
|---|---|
| Default concurrency | 2. This is the concurrency limit for running asynchronous tasks, not for API calls. |
| Adjustable upper limit | You can increase the limit to 30 by calling the UpdateVideoAnalysisConfig API. |
| Higher concurrency | If your business requires higher throughput, contact support to request a limit increase. |
| Queuing mechanism | This 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
116015001424and 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:
- Skill name:
alibabacloud-bailian-videoanalysis - Skill address: https://skills.aliyun.com/skills/alibabacloud-bailian-videoanalysis
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 resourcesis 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
| None | None |
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. | |
| videoModelId | string | No | The unique identifier for the model used in the video vision-language (VL) task. Supported models:
| quanmiao-vl-turbo |
| videoModelCustomPromptTemplate | string | No | The prompt template for the video vision-language (VL) task. This template must include the | # 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
| quanmiao-llm-max |
| modelCustomPromptTemplateId | string | No | The ID of the prompt template for video summarization. Valid values:
The | PlotDetail |
| modelCustomPromptTemplate | string | No | A custom prompt template for the large model used for video summarization. The template must include both the | # 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.
| 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 | 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 | 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 |
| frameSampleMethod | object | No | The frame sampling method. | english |
| methodName | string | No | The sampling method. Valid values:
| standard |
| interval | number | No | The frame sampling interval in seconds. This parameter is valid only when | 2 |
| pixel | integer | No | The maximum pixel length of the longest side of each sampled frame. This parameter is valid only when | 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 | 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 |
| modelCustomPromptTemplate | string | No | A custom prompt template for the large model used for video summarization. The template must include both the | xx |
| modelCustomPromptTemplateId | string | No | The ID of the prompt template for video summarization. Valid values:
The | 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 | 1 |
| excludeGenerateOptions | array | No | Steps to exclude from the generation process.
| |
string | No | A step to exclude from the generation process.
| [\"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 | |
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 | 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 |
|---|---|---|---|
| 403 | NoPermission | You 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.