tencent cloud

APIs

ProcessMediaByProcedure

下载
聚焦模式
字号
最后更新时间: 2026-09-18 15:59:45

1. API Description

Domain name for API request: vod.intl.tencentcloudapi.com.

Use a task flow template to initiate processing tasks for videos in VOD.
There are two ways to create a task flow template:

  1. Create and modify a task flow template in the console;
  2. Create a task flow template through the task flow template API.

For event notification, the type of event notifications other than audio/video moderation tasks is task flow status change; the type of audio/video moderation task event notification is audio/video moderation completed.

A maximum of 100 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: ProcessMediaByProcedure.
Version Yes String Common Params. The value used for this API: 2018-07-17.
Region No String Common Params. This parameter is not required.
ProcedureName Yes String

Name of the task flow.

FileId No String

Media file ID.
Either FileId or MediaStoragePath must be provided.

MediaStoragePath No String

Storage path of the media.
Only sub-apps in FileID + Path mode can initiate tasks through MediaStoragePath.
One of FileId and MediaStoragePath must be provided.

SubAppId No Integer

On-demand application ID. For customers who activate on-demand services from December 25, 2023, this field must be filled in as the app ID when accessing resources in on-demand applications (whether the default application or a newly created application).

TasksPriority No Integer

Priority of the task flow. The higher the value, the higher the priority. The value range is from -10 to 10. If this is not specified, the default value is 0.

TasksNotifyMode No String

Task flow status change notification mode. Valid values are Finish, Change, and None. If this is not specified, the default value is Finish.

SessionContext No String

Source context. This is used to pass user request information. The task status change callback returns the value of this field. The maximum length is 1000 characters.

SessionId No String

Identifier for deduplication. If a request with the same identifier has been sent within the past 7 days, an error is returned for the current request. The maximum length is 50 characters. If this is not specified or left empty, deduplication is not performed.

ExtInfo No String

Reserved field, used for special purposes.

3. Output Parameters

Parameter Name Type Description
TaskId String

Task ID of the task type Procedure. The task is initiated when the task flow template specified by the input parameter ProcedureName includes one or more of MediaProcessTask, AiAnalysisTask, and AiRecognitionTask.

ReviewAudioVideoTaskId String

Task ID of the task type ReviewAudioVideo. This task is initiated when the task flow template specified by the input parameter ProcedureName includes ReviewAudioVideoTask.

ImportMediaKnowledgeTaskIdSet Array of String

Task ID of the task type ImportMediaKnowledge. When the task flow template specified by the input parameter ProcedureName includes ImportMediaKnowledgeTaskSet, initiate the task.

RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Initiating a Task via FileId and Task Flow Template Name

Initiate a task for fileId 5285485487985271487 using the task flow template named TranscodeAndSnapshot.

Input Example

https://vod.intl.tencentcloudapi.com/?Action=ProcessMediaByProcedure
&FileId=5285485487985271487
&ProcedureName=TranscodeAndSnapshot
&<Common request parameters>

Output Example

{
    "Response": {
        "RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
        "TaskId": "125xxx65-procedurev2-bffb15f07530b57bc1aabb01fac74bca",
        "ReviewAudioVideoTaskId": "",
        "ImportMediaKnowledgeTaskIdSet": [
            "2****5-ImportMediaKnowledge-fe26d12dbb53cd75d8f7881253e3266at"
        ]
    }
}

Example2 Initiating a Task via File Path and Task Flow Template Name

Initiate a task for the file at /dir/video.mp4 using the task flow template named TranscodeAndSnapshot.

Input Example

https://vod.intl.tencentcloudapi.com/?Action=ProcessMediaByProcedure
&MediaStoragePath=/dir/video.mp4
&ProcedureName=TranscodeAndSnapshot
&<Common request parameters>

Output Example

{
    "Response": {
        "RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
        "TaskId": "125xxx65-procedurev2-bffb15f07530b57bc1aabb01fac74bca",
        "ReviewAudioVideoTaskId": ""
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation Operation failed.
FailedOperation.InvalidVodUser The VOD service is not activated.
InternalError Internal error.
InvalidParameter Parameter error.
InvalidParameterValue Parameter value error.
InvalidParameterValue.FileId FileId does not exist.
InvalidParameterValue.ProcedureName Task flow template name is invalid.
InvalidParameterValue.SessionContextTooLong SessionContext is too long.
InvalidParameterValue.SessionId Duplicate recognition code. Request deduplicated.
InvalidParameterValue.SessionIdTooLong SessionId is too long.
InvalidParameterValue.SubAppId Parameter value error: app ID.
InvalidParameterValue.UniqueIdentifier Duplicate recognition code within one day. Request deduplicated.
UnauthorizedOperation Unauthorized operation.

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈