tencent cloud

Feedback

DescribeTaskDetail

Last updated: 2022-10-28 17:01:45

1. API Description

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

This API is used to get details of the video moderation task.

A maximum of 20 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: DescribeTaskDetail.
Version Yes String Common Params. The value used for this API: 2021-09-22.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
TaskId Yes String Task ID, which is returned after a task is created
ShowAllSegments No Boolean Whether to show all segments. If it’s not specified, only hit segments are shown.

3. Output Parameters

Parameter Name Type Description
TaskId String This field is used to return the task ID (in the Results parameter) after a video moderation task is created. It is used to identify the moderation task for which to query the details.
Note: This field may return null, indicating that no valid values can be obtained.
DataId String This field is used to return the data ID parameter passed in when the video moderation API is called for easier data identification and management.
Note: This field may return null, indicating that no valid values can be obtained.
BizType String This field is used to return the BizType parameter passed in when the video moderation API is called for easier data identification and management.
Note: This field may return null, indicating that no valid values can be obtained.
Name String This field is used to return the task name in the TaskInput parameter passed in when the video moderation API is called for easier task identification and management.
Note: This field may return null, indicating that no valid values can be obtained.
Status String This field is used to return the task status of the queried content.

Valid values: FINISH (task completed), PENDING (task pending), RUNNING (task in progress), ERROR (task error), CANCELLED (task canceled).
Note: This field may return null, indicating that no valid values can be obtained.
Type String This field is used to return the type of video for moderation. Valid values: VIDEO (video on demand), LIVE_VIDEO (video live streaming). Default value: VIDEO.
Note: This field may return null, indicating that no valid values can be obtained.
Suggestion String This field is used to return the operation suggestion for the maliciousness tag. When you get the determination result, the returned value indicates the operation suggested by the system. We recommend you handle different types of violations and suggestions according to your business needs.
Returned values: Block, Review, Pass.
Note: This field may return null, indicating that no valid values can be obtained.
Labels Array of TaskLabel This field is used to return the maliciousness tag in the detection result.
Values: Normal: normal; Porn: pornographic; Abuse: abusive; Ad: advertising; Custom: custom type of non-compliant content and other offensive, unsafe, or inappropriate types of content.
Note: This field may return null, indicating that no valid values can be obtained.
MediaInfo MediaInfo This field is used to return the details of the input media file, including encoding/decoding formats and segment length. For details, see the description of the MediaInfo data structure.
Note: This field may return null, indicating that no valid values can be obtained.
InputInfo InputInfo This field is used to return the media content information of the moderation service, mainly including the input file type and access URL.
Note: This field may return null, indicating that no valid values can be obtained.
CreatedAt String This field is used to return the creation time of the queried task in ISO 8601 format.
Note: This field may return null, indicating that no valid values can be obtained.
UpdatedAt String This field is used to return the last update time of the queried task in ISO 8601 format.
Note: This field may return null, indicating that no valid values can be obtained.
TryInSeconds Integer Specifies how long, in seconds, to retry
Note: This field may return null, indicating that no valid values can be obtained.
ImageSegments Array of ImageSegments This field is used to return the moderation result of the frames captured from the video. For the detailed returned content, see the description of the ImageSegments data structure.
Note: the data is valid for 24 hours. To extend the storage period, set it in the configured COS bucket.
Note: This field may return null, indicating that no valid values can be obtained.
AudioSegments Array of AudioSegments This field is used to return the moderation result of the audio in the video. For the detailed returned content, see the description of the AudioSegments data structure.
Note: the data is valid for 24 hours. To extend the storage period, set it in the configured COS bucket.
Note: This field may return null, indicating that no valid values can be obtained.
ErrorType String When the task status is Error, the type of the error will be returned. Valid values: DECODE_ERROR: decoding failed (the input resource may contain video that cannot be decoded).
URL_ERROR: download address verification failed.
TIMEOUT_ERROR: processing timed out. When the task status is not Error, null will be returned by default.
Note: This field may return null, indicating that no valid values can be obtained.
ErrorDescription String If the task status is Error, this field will return the error message; otherwise, null will be returned by default.
Note: This field may return null, indicating that no valid values can be obtained.
Label String If the recognition result is normal, this parameter is returned with the value Normal. If malicious content is recognized, the tag with the highest priority in the result of Labels is returned.
Note: This field may return null, indicating that no valid values can be obtained.
AudioText String This field is used to return the recognized text content of an audio file. Up to the first 1,000 characters can be recognized.
Note: This field may return null, indicating that no valid values can be obtained.
Asrs Array of RcbAsr The text content recognized from the audio
Note: This field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Viewing Task Details

This example shows you how to view the details of a task by TaskId.

Input Example

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

{
    "TaskId": "task-video-Xw0mjnmaiu-Uv1fs"
}

Output Example

{
    "Response": {
        "TaskId": "task-video-XwxJtbkKXWgCt8AZ",
        "DataId": "data_test_01",
        "BizType": "1001",
        "Name": "",
        "Status": "FINISH",
        "Type": "VIDEO",
        "Suggestion": "Block",
        "Labels": [
            {
                "Label": "Porn",
                "Suggestion": "Block",
                "Score": 99
            },
            {
                "Label": "Hot",
                "Suggestion": "Block",
                "Score": 70
            }
        ],
        "MediaInfo": {
            "Codecs": "h264 aac",
            "Duration": 36,
            "Width": 352,
            "Height": 640
        },
        "InputInfo": {
            "Type": "URL",
            "Url": "https://cms-video-segments-1256309736.cos.ap-guangzhou.myqcloud.co/huang.mp4",
            "BucketInfo": null
        },
        "CreatedAt": "2020-07-13T11:47:01.925Z",
        "UpdatedAt": "2020-07-13T11:47:25.840Z",
        "ImageSegments": [
            {
                "Result": {
                    "HitFlag": 1,
                    "Label": "Porn",
                    "Suggestion": "Block",
                    "Score": 85,
                    "Results": [
                        {
                            "Scene": "Porn",
                            "HitFlag": 1,
                            "Suggestion": "Block",
                            "Label": "Porn",
                            "SubLabel": "",
                            "Score": 85,
                            "Names": [],
                            "Text": "",
                            "Details": []
                        }
                    ],
                    "Url": "https://cos.ap-zhou.myqcloud.com/c019/image_1.jpg"
                },
                "OffsetTime": "1"
            },
            {
                "Result": {
                    "HitFlag": 1,
                    "Label": "Porn",
                    "Suggestion": "Block",
                    "Score": 77,
                    "Results": [
                        {
                            "Scene": "Porn",
                            "HitFlag": 1,
                            "Suggestion": "Block",
                            "Label": "Porn",
                            "SubLabel": "",
                            "Score": 77,
                            "Names": [],
                            "Text": "",
                            "Details": []
                        }
                    ],
                    "Url": "https://cos.ap-guau.myqcloud.com/cc49b5b90a5d6802b7c019/image_2.jpg"
                },
                "OffsetTime": "2"
            }
        ],
        "AudioSegments": [
            {
                "Result": {
                    "HitFlag": 0,
                    "Label": "Normal",
                    "SubLabel": "",
                    "Suggestion": "Pass",
                    "Score": 0,
                    "Text": "Test audio text",
                    "Url": "https://xxx.com/7c019/audio_0.mp3",
                    "Duration": "36398"
                },
                "OffsetTime": "0"
            }
        ],
        "RequestId": "8d3e4765-48db-40b5-8fdb-aaf1d7225a60",
        "ErrorType": "",
        "ErrorDescription": "",
        "TryInSeconds": 0,
        "Label": "Porn",
        "AudioText": "",
        "Asrs": []
    }
}

Example2 ok

Input Example

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

{
    "ShowAllSegments": "true",
    "TaskId": "w-video-YyBIZHP6L4buPOcg"
}

Output Example

{
    "Response": {
        "TaskId": "w-video-YyBIZHP6L4buPOcg",
        "DataId": "1111",
        "BizType": "default",
        "Name": "111",
        "Status": "RUNNING",
        "Type": "VIDEO",
        "Suggestion": "UNSPECIFIED",
        "Labels": [],
        "InputInfo": {
            "Type": "URL",
            "Url": "https://test-resources-1306254157.cos.ap-guangzhou.myqcloud.com/audio_policy_test/4%E5%88%86%E9%92%9F%E8%B6%85%E9%95%BF.m4a",
            "BucketInfo": null
        },
        "MediaInfo": {
            "Codecs": "",
            "Duration": 0,
            "Width": 0,
            "Height": 0,
            "Thumbnail": ""
        },
        "AudioText": "",
        "ImageSegments": [],
        "AudioSegments": [],
        "TryInSeconds": 0,
        "CreatedAt": "2022-09-13T09:07:48.926Z",
        "UpdatedAt": "2022-09-13T09:07:49.059Z",
        "ErrorType": "",
        "ErrorDescription": "",
        "Asrs": [],
        "Label": "",
        "RequestId": "ba257e71-a04b-4ba9-9d67-0717a39b6a96"
    }
}

Example3 Querying VM details

Input Example

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

{
    "ShowAllSegments": "true",
    "TaskId": "w-live_audio-YyBybeJJPvjum5DP"
}

Output Example

{
    "Response": {
        "TaskId": "w-live_audio-YyBybeJJPvjum5DP",
        "DataId": "1111",
        "BizType": "default",
        "Name": "111",
        "Status": "RUNNING",
        "Type": "LIVE_AUDIO",
        "Suggestion": "UNSPECIFIED",
        "Labels": [],
        "InputInfo": {
            "Type": "URL",
            "Url": "https://test-resources-1306254157.cos.ap-guangzhou.myqcloud.com/audio_policy_test/4%E5%88%86%E9%92%9F%E8%B6%85%E9%95%BF.m4a",
            "BucketInfo": null
        },
        "MediaInfo": {
            "Codecs": "",
            "Duration": 0,
            "Width": 0,
            "Height": 0,
            "Thumbnail": ""
        },
        "AudioText": "",
        "ImageSegments": [],
        "AudioSegments": [],
        "TryInSeconds": 120,
        "CreatedAt": "2022-09-13T12:07:09.338Z",
        "UpdatedAt": "2022-09-13T12:07:09.623Z",
        "ErrorType": "",
        "ErrorDescription": "",
        "Asrs": [],
        "Label": "",
        "RequestId": "08895eaa-2c51-4dc6-94fc-7b9bad51632b"
    }
}

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
DryRunOperation DryRun operation, which means the DryRun parameter is passed in yet the request will still be successful.
FailedOperation Operation failed.
InternalError Internal error.
InvalidParameter Parameter error.
InvalidParameterValue Invalid parameter value.
LimitExceeded The quota limit has been reached.
MissingParameter Missing parameter.
OperationDenied Operation denied.
RequestLimitExceeded The number of requests exceeds the frequency limit.
ResourceInUse The resource is occupied.
ResourceInsufficient Insufficient resource.
ResourceNotFound The resource doesn’t exist.
ResourceUnavailable The resource is unavailable.
ResourcesSoldOut The resources have been sold out.
UnauthorizedOperation Unauthorized operation.
UnknownParameter Unknown parameter error.
UnsupportedOperation Unsupported operation.