ProcessMediaByUrl

Last updated: 2020-08-14 09:41:31

1. API Description

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

This API is used to initiate a processing task for an audio/video media file from a URL, including:

  1. Intelligent content audit (detection of porn, terrorism, and politically sensitive information);
  2. Intelligent content analysis (tag, category, cover, and frame-specific tag);
  3. Intelligent content recognition (opening and closing credits, face, full text, text keyword, full speech, speech keyword, and object).

If the event notification is used, its type is Task Flow Status Change.

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 parameter. The value used for this API: ProcessMediaByUrl.
Version Yes String Common parameter. The value used for this API: 2018-07-17.
Region No String Common parameter. This parameter is not required for this API.
InputInfo No MediaInputInfo Information of input video, including video's URL, name, and custom ID.
OutputInfo No MediaOutputInfo Information of COS path to output file.
AiContentReviewTask No AiContentReviewTaskInput Type parameter of video content audit task.
AiAnalysisTask No AiAnalysisTaskInput Video content analysis task parameter.
AiRecognitionTask No AiRecognitionTaskInput Type parameter of video content recognition task.
TasksPriority No Integer Task flow priority. The higher the value, the higher the priority. Value range: -10-10. If this parameter is left empty, 0 will be used.
TasksNotifyMode No String Notification mode for task flow status change. Valid values: Finish, Change, None. If this parameter is left empty, Finish will be used.
SessionContext No String The source context which is used to pass through the user request information. The task flow status change callback will return the value of this field. It can contain up to 1,000 characters.
SessionId No String The ID used for deduplication. If there was a request with the same ID in the last seven days, the current request will return an error. The ID can contain up to 50 characters. If this parameter is left empty or a blank string is entered, no deduplication will be performed.
SubAppId No Integer Subapplication ID in VOD. If you need to access a resource in a subapplication, enter the subapplication ID in this field; otherwise, leave it empty.

3. Output Parameters

Parameter Name Type Description
TaskId String Task ID
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Initiating a content analysis task

This example shows you how to initiate a content analysis task for a video whose URL is http://www.abc.com/abc.mp4.

Input Example

https://vod.tencentcloudapi.com/?Action=ProcessMediaByUrl
&InputInfo.Url=http://www.abc.com/abc.mp4
&InputInfo.Name=Major Country Diplomacy
&InputInfo.Id=872988202
&OutputInfo.Region=ap-guangzhou
&OutputInfo.Bucket=myoutputbucket-1256244234
&OutputInfo.Dir=/output/test/
&AiAnalysisTask.Definition=10
&<Common request parameters>

Output Example

{
  "Response": {
    "RequestId": "5ca61e3a-6b8e-4b4e-9256-fdc701190064ef0",
    "TaskId": "125xxxxxx07-procedurev2-813dc41e6fdc22dcf24aa6e9c61cp92"
  }
}

Example2 Initiating a content audit task

This example shows you how to initiate a content audit task for a video whose URL is http://www.abc.com/abc.mp4.

Input Example

https://vod.tencentcloudapi.com/?Action=ProcessMediaByUrl
&InputInfo.Url=http://www.abc.com/abc.mp4
&InputInfo.Name=Major Country Diplomacy
&InputInfo.Id=872988202
&OutputInfo.Region=ap-guangzhou
&OutputInfo.Bucket=myoutputbucket-1256244234
&OutputInfo.Dir=/output/test/
&AiContentReviewTask.Definition=10
&<Common request parameters>

Output Example

{
  "Response": {
    "RequestId": "5ca61e3a-6b8e-4b4e-9256-fdc701190064ef0",
    "TaskId": "125xxxxxx07-procedurev2-893dc41e6fdc22dcf24aa6e9c61cp94"
  }
}

Example3 Initiating a content recognition task

This example shows you how to initiate a content recognition task for a video whose URL is http://www.abc.com/abc.mp4.

Input Example

https://vod.tencentcloudapi.com/?Action=ProcessMediaByUrl
&InputInfo.Url=http://www.abc.com/abc.mp4
&InputInfo.Name=Major Country Diplomacy
&InputInfo.Id=872988202
&OutputInfo.Region=ap-guangzhou
&OutputInfo.Bucket=myoutputbucket-1256244234
&OutputInfo.Dir=/output/test/
&AiRecognitionTask.Definition=10
&<Common request parameters>

Output Example

{
  "Response": {
    "RequestId": "5ca61e3a-6b8e-4b4e-9256-fdc701190064fk3",
    "TaskId": "125xxxxxx07-procedurev2-813dc41e6fdc22dcf24aa6e9c61f3t0"
  }
}

5. Developer Resources

API Explorer

This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

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.TaskDuplicate Operation failed: the task already exists.
InternalError Internal error.
InternalError.GetFileInfoError Internal error: an error occurred while getting media file information.
InvalidParameter Invalid parameter.
InvalidParameterValue.AiAnalysisTaskDefinition Incorrect parameter value: Definition for AI-based analysis.
InvalidParameterValue.AiContentReviewTaskDefinition Incorrect parameter value: Definition AI-based content audit.
InvalidParameterValue.AiRecognitionTaskDefinition Incorrect parameter value: Definition for AI-based recognition.
InvalidParameterValue.SessionContextTooLong SessionContext is too long.
InvalidParameterValue.SessionId The deduplication ID already exists. The request is removed due to duplication.
InvalidParameterValue.SessionIdTooLong SessionId is too long.
InvalidParameterValue.SubAppId Incorrect parameter value: subapplication ID
UnauthorizedOperation Unauthorized operation.

Was this page helpful?

Was this page helpful?

  • Not at all
  • Not very helpful
  • Somewhat helpful
  • Very helpful
  • Extremely helpful
Send Feedback
Help