tencent cloud

APIs

ProcessMedia

ダウンロード
フォーカスモード
フォントサイズ
最終更新日: 2026-09-18 16:50:27

1. API Description

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

This API is used to initiate processing tasks for audio-video media in VOD, with features including:

  1. Watermarked video transcoding;
  2. Animated image generating;
  3. Screenshot taking at specified time points;
  4. Sampled screenshot taking;
  5. Capture CSS sprites for videos;
  6. Capture a frame from a video as the cover.
  7. Transcoding to adaptive bitrate streaming with encryption;
  8. Content review (offensive content, unsafe information, inappropriate information). It is not recommended to use this API to initiate it. Audio/Video Moderation (ReviewAudioVideo) or Image Moderation (ReviewImage) is recommended;
  9. Content analysis (tag, category, cover, frame tagging) is not supported for HLS format currently.
  10. Content recognition (video intro and outro, human face, full text, text keyword, full speech, speech keyword, object).

If event notification is used, its type is task flow status change (https://www.tencentcloud.com/document/product/266/9636?from_cn_redirect=1).

A maximum of 200 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: ProcessMedia.
Version Yes String Common Params. The value used for this API: 2018-07-17.
Region No String Common Params. This parameter is not required.
FileId No String

Media file ID, the globally unique identifier of the file on VOD, assigned by the VOD backend after successful upload. You can obtain this field in video upload completion event notification or the VOD console.
You must provide either FileId or MediaStoragePath.

MediaStoragePath No String

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

SubAppId No Integer

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

MediaProcessTask No MediaProcessTaskInput

Video processing type task parameters.

AiContentReviewTask No AiContentReviewTaskInput

Audio and video content review type task parameters .
Not recommended for use. Recommended for use: Audio/Video Moderation (ReviewAudioVideo) or Image Moderation (ReviewImage).

AiAnalysisTask No AiAnalysisTaskInput

Parameters for the audio and video content analysis task.

AiRecognitionTask No AiRecognitionTaskInput

Audio/video content recognition type task parameter.

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 three 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.

Url No String

Valid when FileID is empty. Pull the Url to generate a new media asset and a new FileID. Media processing products will be affiliated products of the new media asset.

Note: Storage fees will occur for the new media asset.

OutputAsIndependentMedia No String

The media processing transcoding result is output as standalone media assets. Enabling this option will output the product as standalone media assets and generate a brand new FileID. Currently, only TranscodeTask transcoding task output is supported as standalone media assets.

Enumeration values:

  • ON: enable
  • OFF: disable

Default value: OFF

Note: New media assets will incur storage fees. This option does not currently support enabling for video opening/closing credits, traceable watermarks, and other features in transcoding tasks.

3. Output Parameters

Parameter Name Type Description
TaskId String

Task ID.

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 Use a file path to trigger a content recognition task

This example shows you how to initiate a content recognition task for a video with the file path /dir/video.mp4, including face recognition, using template ID 10.

Input Example

POST / HTTP/1.1
Host: vod.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ProcessMedia
<Common request parameters>

{
    "AiRecognitionTask": {
        "Definition": 10
    },
    "MediaStoragePath": "/dir/video.mp4"
}

Output Example

{
    "Response": {
        "RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc70006fje1",
        "TaskId": "125xxx65-procedurev2-bffb15f07586237bcecodb01fac7kdabc"
    }
}

Example2 Triggering a Content Review Task

Initiate a content review task for the video with fileId 5285485487985271487 (offensive, unsafe, and inappropriate information), using content review template ID 10.

Input Example

POST / HTTP/1.1
Host: vod.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ProcessMedia
<Common request parameters>

{
    "AiContentReviewTask": {
        "Definition": 10
    },
    "FileId": "5285485487985271487"
}

Output Example

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

Example3 Trigger a content recognition task

This example shows you how to initiate a content recognition task for a video with the file ID 5285485487985271487, including face recognition, using template ID 10.

Input Example

POST / HTTP/1.1
Host: vod.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ProcessMedia
<Common request parameters>

{
    "AiRecognitionTask": {
        "Definition": 10
    },
    "FileId": "5285485487985271487"
}

Output Example

{
    "Response": {
        "RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc70006fje1",
        "TaskId": "125xxx65-procedurev2-bffb15f07586237bcecodb01fac7kdabc"
    }
}

Example4 Initiating a Watermarked Transcoding Task

This example shows you how to initiate a transcoding task for the video with fileId 5285485487985271487, transfer three specifications using transcoding template IDs 20, 30, and 40, and add a watermark to all transcoded videos with the watermark template ID 15780.

Input Example

POST / HTTP/1.1
Host: vod.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ProcessMedia
<Common request parameters>

{
    "MediaProcessTask": {
        "TranscodeTaskSet": [
            {
                "Definition": 30,
                "WatermarkSet": [
                    {
                        "Definition": 15780
                    }
                ]
            },
            {
                "Definition": 20,
                "WatermarkSet": [
                    {
                        "Definition": 15780
                    }
                ]
            },
            {
                "Definition": 40,
                "WatermarkSet": [
                    {
                        "Definition": 15780
                    }
                ]
            }
        ]
    },
    "FileId": "5285485487985271487"
}

Output Example

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

Example5 Triggering an Intelligent Content Analysis Task

Trigger a content analysis task for the video with fileId 5285485487985271487, including intelligent categorization, intelligent tag, and intelligent cover. The template ID used for content analysis is 10.

Input Example

POST / HTTP/1.1
Host: vod.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ProcessMedia
<Common request parameters>

{
    "AiAnalysisTask": {
        "Definition": 10
    },
    "FileId": "5285485487985271487"
}

Output Example

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

Example6 Initiating a Transcoding Task

This example shows you how to initiate a transcoding task for a video with fileId 5285485487985271487, transfer three specifications, and the transcoding template IDs used are 20, 30, and 40, respectively.

Input Example

POST / HTTP/1.1
Host: vod.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ProcessMedia
<Common request parameters>

{
    "MediaProcessTask": {
        "TranscodeTaskSet": [
            {
                "Definition": 30
            },
            {
                "Definition": 20
            },
            {
                "Definition": 40
            }
        ]
    },
    "FileId": "5285485487985271487"
}

Output Example

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

Example7 Initiating Transcoding and Sampling Screenshot Tasks

Initiate a transcoding task for the video with fileId 5285485487985271487 to transfer three specifications. The transcoding template IDs used are 20, 30, and 40, respectively. At the same time, take sampled screenshots of the video using the sampled screenshot template ID 10.

Input Example

POST / HTTP/1.1
Host: vod.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ProcessMedia
<Common request parameters>

{
    "MediaProcessTask": {
        "TranscodeTaskSet": [
            {
                "Definition": 30
            },
            {
                "Definition": 20
            },
            {
                "Definition": 40
            }
        ],
        "SampleSnapshotTaskSet": [
            {
                "Definition": 10
            }
        ]
    },
    "FileId": "5285485487985271487"
}

Output Example

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

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.
FailedOperation.NoNeedToReduceMediaBitrate No need for bitrate reduction.
FailedOperation.TaskDuplicate Operation failed: duplicate task.
InternalError Internal error.
InvalidParameter Parameter error.
InvalidParameterValue Parameter value error.
InvalidParameterValue.AiAnalysisTaskDefinition Parameter value error: AI analysis Definition.
InvalidParameterValue.AiContentReviewTaskDefinition Parameter value error: AI content review Definition.
InvalidParameterValue.AiRecognitionTaskDefinition Parameter value error: AI recognition Definition.
InvalidParameterValue.FileId FileId does not exist.
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.
UnauthorizedOperation Unauthorized operation.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック