Video file moderation enhanced 2.0 API

更新时间:
复制 MD 格式

Content moderation, enhanced edition, helps you detect risky or non-compliant content in video files. This article shows how to use the API for content moderation and AIGC marker detection.

Integration

  1. Sign up for an Alibaba Cloud account. Sign up now. Follow the on-screen instructions to register.

  2. Activate pay-as-you-go for Content Moderation. For details, see Activate Service. Activation is free of charge. Billing is based on API usage. For more information, see Billing. You can also purchase a subscription resource plan. This plan offers tiered discounts over the pay-as-you-go model and is ideal for predictable or high usage. For more information, see Purchase a subscription resource plan.

  3. Create an AccessKey in RAM. For instructions, see Create an AccessKey. If you use a RAM user's AccessKey (sub-account), grant the AliyunYundunGreenWebFullAccess permission to the RAM user using your Alibaba Cloud account (primary account). For instructions, see RAM authorization.

  4. We recommend using an SDK to call the APIs. For more information, see Video Moderation-Enhanced 2.0 SDK and integration guide.

  5. The video file moderation service includes the following 2 APIs:

    • VideoModeration: Submits a video file moderation task.

    • VideoModerationResult: Gets the video file moderation result.

Submit a moderation task

API

  • API operation: VideoModeration. This operation supports only asynchronous detection of video files.

  • Supported regions and endpoints:

    Region

    Public endpoint

    Private endpoint

    Services

    China (Shanghai)

    green-cip.cn-shanghai.aliyuncs.com

    green-cip-vpc.cn-shanghai.aliyuncs.com

    videoDetection, videoDetectionByVL, videoAigcDetector

    China (Beijing)

    green-cip.cn-beijing.aliyuncs.com

    green-cip-vpc.cn-beijing.aliyuncs.com

    China (Hangzhou)

    green-cip.cn-hangzhou.aliyuncs.com

    green-cip-vpc.cn-hangzhou.aliyuncs.com

    videoDetection

    China (Shenzhen)

    green-cip.cn-shenzhen.aliyuncs.com

    Not available

    Singapore

    green-cip.ap-southeast-1.aliyuncs.com

    green-cip-vpc.ap-southeast-1.aliyuncs.com

    videoDetection_cb, videoDetectionByVL_cb

    US (Virginia)

    green-cip.us-east-1.aliyuncs.com

    green-cip-vpc.us-east-1.aliyuncs.com

    videoDetection_cb

    US (Silicon Valley)

    green-cip.us-west-1.aliyuncs.com

    Not available

    Germany (Frankfurt)

    green-cip.eu-central-1.aliyuncs.com

    Not available

  • Billing:

    This is a paid operation. You are billed based on the video frame and audio moderation policies that you configure. For video frames, you can select multiple services. The total fee is the number of captured frames multiplied by the unit price of each selected service. If you also enable audio content moderation, you will incur an additional fee. This fee is calculated by multiplying the video duration by the unit price of the audio moderation feature. For more information about billing, see Billing.

  • Moderation target: This service supports video files.

  • Response: Asynchronous detection tasks do not return results in real time. You can retrieve results by using callbacks or polling. Results are retained for a maximum of 24 hours.

    • Retrieve results by using a callback: When you submit an asynchronous detection task, include the callback parameter in the request to automatically receive the results.

    • Retrieve results by using polling: When you submit an asynchronous detection task, do not include the callback parameter. After the task is submitted, call the results query API to get the results.

  • Video requirements:

    • The video file URL must use the HTTP or HTTPS protocol.

    • The service supports the following video file formats: AVI, FLV, MP4, MPG, ASF, WMV, MOV, WMA, RMVB, RM, FLASH, TS, M3U8, and more.

    • Video size limit: By default, the maximum size of a single video file is 500 MB. If your video file exceeds this limit, you can use chunking. Alternatively, you can contact us to increase the size limit.

    • Video moderation time depends on the file's download speed. To ensure a stable and reliable download, we recommend that you store your video files on Alibaba Cloud OSS.

  • Moderation rule configuration:

    • Before you call this operation for the first time, you must configure video moderation rules in the Content Moderation console.

      Note

      In the console, you can configure settings such as the frame capturing method, frame capturing frequency, frame moderation rules, audio moderation rules, and the scope of the results. For instructions, see the Console User Guide.

  • By default, the video review Enhanced Edition API uses the following settings:

    Service

    Default configuration

    Video File Detection (videoDetection)

    • Frame capture interval: 1 second

    • Video frame detection service: Video/Live Stream Screenshot Detection (liveStreamCheck)

    • Video audio detection: Enabled

    • Video audio detection service: Audio and Video Media Detection (audio_media_detection)

    • Result return method: Returns only results indicating risk.

    Video File Detection (Cross-border) (videoDetection_cb)

    Note

    Available in the Singapore and US (Virginia) regions.

    • Frame capture interval: 1 second

    • Video frame detection service: General Baseline Detection (Cross-border) (baselineCheck_cb)

    • Video audio detection: Enabled

    • Video audio detection service: Audio and Video Media Detection (Cross-border) (audio_media_detection_cb)

    • Result return method: Returns only results indicating risk.

    Video File Detection (Large Model Edition) (videoDetectionByVL)

    Note

    Available only in the China (Beijing) and China (Shanghai) regions. Concurrency is limited to 10 tasks.

    • Frame capture interval: 1 second

    • Video frame detection service: Hybrid Large and Small Model Image Moderation Service (postImageCheckByVL)

    • Video audio detection: Enabled

    • Video audio detection service: Audio and Video Media Detection (audio_media_detection)

    • Result return method: Returns only results indicating risk.

    Video File Detection (Large Model, Cross-border) (videoDetectionByVL_cb)

    Note

    Available only in the Singapore region. Concurrency is limited to 10 tasks.

    • Frame capture interval: 1 second

    • Video frame detection service: Hybrid Large and Small Model Image Moderation Service (Cross-border) (postImageCheckByVL_cb)

    • Video audio detection: Enabled

    • Video audio detection service: Audio and Video Media Detection (Cross-border) (audio_media_detection_cb)

    • Result return method: Returns only results indicating risk.

    AI-Generated Video Detection (videoAigcDetector)

    Note

    Available only in the China (Beijing) and China (Shanghai) regions.

    • Frame capture interval: 1 second

    • Video frame detection service: AI-Generated Image Detection (for Video Frames) (aigcDetectorForFrame)

    • Video audio detection: Enabled

    • Video audio detection service: AI-Generated Voice Detection (voice_aigc_detector)

    • Result return method: Returns only results indicating risk.

Rate limits

Each user is limited to 100 QPS and a concurrency limit of 50, which means you can process up to 50 tasks at once. To increase this limit, contact your account manager. Exceeding these limits triggers rate limiting, which can impact your business.

Debugging

Before integrating, you can use Alibaba Cloud OpenAPI to debug the VideoModeration API and review the sample code and SDK dependencies to familiarize yourself with the API's usage and parameters.

Important

The online debugging feature calls the Content Moderation API under your account, and these calls will count towards your billable usage.

Request parameters

Parameter

Type

Required

Example value

Description

Service

String

Yes

videoDetection

Specifies the content moderation service. Valid values:

  • videoDetection: Video file detection.

  • videoDetection_cb: For video file detection outside the Chinese mainland.

  • videoDetectionByVL: Video file detection (large model version).

  • videoDetectionByVL_cb: For video file detection outside the Chinese mainland (large model version).

  • videoAigcDetector: Detects AI-generated content in videos.

ServiceParameters

JSON string

Yes

Service-specific parameters, formatted as a JSON string. For details, see Table 1 ServiceParameters.

Table 1. Service parameters

Parameter

Type

Required

Example value

Description

url

String

Yes. You can provide a video in one of the following three ways:

  • To detect content by using a video URL, specify the url parameter.

  • To detect content by using an authorized OSS object, you must specify the ossBucketName, ossObjectName, and ossRegionId parameters.

  • Upload a local video file. This method does not use your OSS storage, and the file is stored for only 30 minutes. The SDK provides functionality to upload local videos. For sample code, see Video Moderation Enhancement 2.0 SDK and Integration Guide.

http://www.aliyundoc.com/a.flv

The URL of the video to moderate. The URL must be accessible from the internet or be an internal OSS endpoint in the same region.

Note

The URL must not contain Chinese characters or exceed 2,048 characters. Submit only one URL per request.

ossBucketName

String

bucket_01

The name of the authorized OSS bucket.

Note

To use an internal OSS URL, you must first use your Alibaba Cloud account to grant access on the Cloud Resource Access Authorization page.

ossObjectName

String

20240307/07/28/test.flv

The name of the file in the authorized OSS bucket.

ossRegionId

String

cn-shanghai

The region where the OSS bucket is located.

callback

String

No

http://www.aliyundoc.com

The URL for receiving callback notifications with the moderation results. The URL must support HTTP and HTTPS. If you do not specify this parameter, you must periodically poll for the results.

Your callback endpoint must support the POST method, UTF-8 encoded data, and the checksum and content form parameters.

Content Moderation generates the checksum and content values based on the following rules and sends them to your callback endpoint.

  • checksum: A string generated by applying the SHA-256 algorithm to the concatenated string of user UID + seed + content. The user UID is your Alibaba Cloud account ID, which can be found in the Alibaba Cloud Console. To prevent tampering, verify the checksum by recalculating the signature with the same algorithm when you receive the callback notification.

    Note

    The UID must belong to your Alibaba Cloud account, not a RAM user.

  • content: A value in JSON string format. You must parse it into a JSON object. For an example of the content result, see the example response for querying detection results.

Note

When your callback endpoint receives a result from Content Moderation, it must return an HTTP status code of 200 to acknowledge receipt. Any other status code indicates a failure. If a failure occurs, Content Moderation retries sending the result up to 16 times. If all retries fail, the service stops retrying. We recommend that you check the status of your callback endpoint.

seed

String

No

abc****

A random string used for signing the callback notification request.

This user-defined string can contain letters, digits, and underscores (_), and must not exceed 64 characters in length. This value allows you to verify that the callback notification originates from the Content Moderation service.

Note

This parameter is required if you specify the callback parameter.

cryptType

String

No

SHA256

If you use callback notifications, this parameter specifies the algorithm for signing the callback payload. Content Moderation uses this algorithm to calculate a signature for the string (a concatenation of user UID + seed + content) and sends the signature to your callback URL. Valid values:

  • SHA256 (Default): Uses the SHA-256 algorithm.

  • SM3: Uses the HMAC-SM3 algorithm. The result is a lowercase hexadecimal string.

    For example, the SM3 hash of abc is 66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0.

dataId

String

No

videoId****

A data ID that corresponds to the object to moderate.

This ID is used to uniquely identify your business data. It can contain uppercase and lowercase letters, digits, underscores (_), hyphens (-), and periods (.), and must not exceed 128 characters.

offline

String

No

false

Specifies whether to use the offline detection mode.

  • false (Default): real-time detection mode. Requests that exceed the concurrency limit are rejected.

  • true: offline detection mode. Tasks are queued and are not guaranteed to be processed in real time, but detection begins within 24 hours.

Important

This parameter is a string. The offline detection mode is supported in the China (Beijing), China (Shanghai), and China (Hangzhou) regions.

referer

String

No

www.aliyun.com

The Referer request header, used for hotlink protection. It must not exceed 256 characters.

infoType

String

No

customImage,textInImage

Specifies the types of auxiliary information to return. When this parameter is set, the moderation result for each captured frame includes the corresponding auxiliary information. Valid values:

  • customImage: Custom image library hit information.

  • textInImage: Text detected in the image (OCR result).

  • publicFigure: Public figure match information.

  • logoData: Logo and trademark detection information.

  • vlContent: Raw results from the large model analysis.

You can specify multiple values separated by commas. For example, customImage,textInImage returns both custom image library hit information and text detected in the image.

Note

When Content Moderation pushes a detection result to your server-side callback interface, the delivery is successful only if your interface returns an HTTP status code of 200. Any other HTTP status code is considered a failure. If a delivery fails, Content Moderation will retry the delivery up to 16 times. If all 16 attempts are unsuccessful, Content Moderation stops pushing the result. In this case, you should check the status of your callback interface.

Return value

Parameter

Type

Example value

Description

Code

Integer

200

The status code. For more information, see Code description.

Data

JSONObject

An object that contains the moderation results.

TaskId

String

AAAAA-BBBBB

The ID of the detection task.

DataId

String

dataId0307

The data ID.

Message

String

OK

The response message.

RequestId

String

ABCD1234-1234-1234-1234-123****

The request ID.

Example

Request example

{
    "Service": "videoDetection",
    "ServiceParameters": {
        "url": "http://www.aliyundoc.com/a.flv",
        "dataId": "videoId****"
    }
}

Successful response example

{
    "Message": "OK",
    "Code": 200,
    "Data": {
        "TaskId": "AAAAA-BBBBB",
        "DataId": "videoId****"
    },
    "RequestId": "ABCD1234-1234-1234-1234-123****"
}

Video moderation result

API

  • API operation: VideoModerationResult. Retrieves the results of a video file moderation task.

  • Billing: This API is free of charge.

  • Query timeout: We recommend waiting 30 seconds after submitting an asynchronous detection task before querying for the result. Results not retrieved within 24 hours are automatically deleted.

Rate limits

This API is limited to 100 QPS per user. Calls exceeding this limit are throttled, potentially affecting your business.

Debugging

Before integrating, you can also use Alibaba Cloud OpenAPI to debug the VideoModerationResult API online, review sample code and SDK dependencies, and get an overview of its usage and parameters.

Request parameters

Parameter

Type

Required

Example

Description

Service

String

Yes

videoDetection

The moderation service type. Must match the type you specified when submitting the moderation task.

ServiceParameters

JSON string

Yes

The required parameter set for the moderation service, in JSON string format. For details about each field, see Table 1 ServiceParameters.

Table 1: ServiceParameters

Parameter

Type

Required

Example

Description

taskId

string

Yes

abcd****

The ID of the detection task. Only one taskId can be specified per request.

Note

After you submit a detection task, the response contains the taskId.

Response parameters

Parameter

Type

Example value

Description

RequestId

String

ABCD1234-1234-1234-1234-123****

The unique identifier for the request, generated by Alibaba Cloud. Use this ID to troubleshoot and locate issues.

Data

Object

The video content moderation result. For details, see Table 2 Data.

Code

String

200

The HTTP status code. For details, see Code description.

Message

String

OK

The response message.

Table 2. Data

Parameter

Type

Example

Description

DataId

String

videoId****

The data ID for the detection object.

Note

If you specify a data ID in the detection request parameters, this field returns the same ID.

TaskId

String

AAAAA-BBBBB-2024-0307

The detection task ID.

RiskLevel

String

high

The combined risk level of the video's frames and audio. The possible values are:

  • high: high risk

  • medium: medium risk

  • low: low risk

  • none: no risk detected

Note

Handle high-risk content directly. For medium-risk content, we suggest a manual review. Address low-risk content only when high recall is required; otherwise, treat it as content with no risk detected. You can configure the risk scores for video frames in the Content Moderation Console.

FrameResult

JSONObject

The result of the video frame detection. If the call is successful (code=200), this field contains a structure. For details about the structure, see Table 3 FrameResult.

Note

In a video stream detection scenario, a code of 280 indicates that detection is in progress, while 200 indicates that it is complete. While detection is in progress, the result includes all findings up to the current time.

AudioResult

JSONObject

The result of the audio detection. This field contains a structure. For details about the structure, see Table 13 audioResult.

ManualTaskId

String

m_vi_042407280307***

The manual review task ID, which you can use to query the manual review result. Returned only if you have configured human and machine review and the content meets the conditions for manual review. For configuration details, see Human and Machine Review Service Configuration.

Ext

Object

Additional reference information about the video. For more information, see Extended Fields.

Table 3: FrameResult

Parameter

Type

Value

Description

FrameNum

Integer

200

Total number of frames captured from the video.

FrameSummarys

JSONArray

Summary of labels detected in video frames. See Table 4 FrameSummary for the structure.

RiskLevel

String

high

The video's risk level, calculated from all its frames. Valid values are:

  • high: High risk

  • medium: Medium risk

  • low: Low risk

  • none: No risk was detected

Frames

JSONArray

Information about video frames that triggered a label hit. See Table 5 Frame for the structure.

Table 4: FrameSummary

Parameter

Type

Value

Description

Label

String

violent_armedForces

The video frame label.

Description

String

Suspected fireworks-related elements

Describes the Label field.

Important

This field provides a description of the Label field and is subject to change. Base your logic on the Label field, not this one.

LabelSum

Integer

8

The number of times the label appears.

Table 5. frame

Parameter

Type

Example

Description

TempUrl

String

http://www.aliyundoc.com/test.jpg

A temporary URL for the video frame. The URL is valid for 30 minutes.

Note

If video evidence storage is enabled, this parameter returns the OSS URL of the stored video frame instead.

Offset

Float

50.5

The timestamp of the video frame from the start of the video, in seconds.

RiskLevel

String

high

The risk level of the video frame, based on the configured risk score thresholds. Valid values:

  • high: high risk

  • medium: medium risk

  • low: low risk

  • none: no risk detected

Note

Take immediate action on high-risk content and manually review medium-risk content. Treat low-risk content the same as content with no detected risk, unless you require high recall. You can configure the risk scores for video frames in the Content Moderation console.

Results

JSONArray

An array of objects with the moderation results for the video frame, such as risk labels and confidence scores. For more information, see Table 6. Results.

Table 6. Results

Parameter

Type

Value

Description

Service

String

liveSteamCheck

The video moderation service used.

Result

Array

An array of objects containing the frame-by-frame moderation results, such as risk labels and confidence scores. For more information, see Table 7 Result.

CustomImage

JSONArray

Custom image library hit information. Returned when infoType is set in the request parameters and a custom image library is matched. For the structure, see Table 8 CustomImage.

TextInImage

JSONObject

Text detected in the captured frame (OCR result). Returned when infoType is set in the request parameters. For the structure, see Table 9 TextInImage.

PublicFigure

JSONArray

Public figure match information. Returned when infoType is set in the request parameters and a public figure is matched. For the structure, see Table 10 PublicFigure.

LogoData

JSONArray

Logo and trademark detection information. Returned when infoType is set in the request parameters and a logo is matched. For the structure, see Table 11 LogoData.

VlContent

JSONObject

Text analysis results from the large model. Returned when infoType is set in the request parameters and a large model service (such as videoDetectionByVL) is used. For the structure, see Table 12 VlContent.

Table 7: Result

Parameter

Type

Example value

Description

Label

String

violent_explosion

The label for content detected in the video frame. A video frame can have multiple labels, each with a corresponding confidence score. Supported labels include:

Confidence

Float

81.22

A confidence score from 0 to 100, rounded to two decimal places.

Description

String

Suspected pyrotechnic-related content

A description of the label field.

Important

This field describes the label field and is subject to change. Base your application logic on the label field, not the Description field.

Auxiliary information in response (click to expand)

Table 8. CustomImage

Data structure for custom image library hit information.

Parameter

Type

Example value

Description

LibId

String

303074761XXXX

The ID of the matched custom image library.

ImageId

String

94XXXX

The ID of the matched image in the custom image library.

Table 9. TextInImage

Text recognition information detected in the captured frame.

Parameter

Type

Example value

Description

OcrDatas

JSONArray

["Great Wall ORA"]

A list of recognized text strings. Each element is a piece of recognized text.

Table 10. PublicFigure

Public figure match information.

Parameter

Type

Example value

Description

FigureId

String

3647ca8a

The unique identifier of the public figure.

FigureName

String

XXX

The name of the identified public figure.

Location

JSONArray

[{"W":33,"H":42,"X":199,"Y":288}]

The coordinates of the public figure in the captured frame. W is the width, H is the height, X and Y are the top-left corner coordinates, all in pixels.

Table 11. LogoData

Logo and trademark detection information.

Parameter

Type

Example value

Description

Location

JSONObject

{"W":175,"X":151,"H":174,"Y":192}

The location of the logo in the captured frame. W is the width, H is the height, X and Y are the top-left corner coordinates, all in pixels.

Table 12. VlContent

Text analysis results from the large model.

Parameter

Type

Example value

Description

OutputText

String

Political, other. Military/police uniforms, minors, other flags, politically sensitive locations.

The text analysis result from the large model for the captured frame, including detected risk categories and specific risk elements.

Table 13: audioResult

Parameter

Type

Example value

Description

AudioSummarys

JSONArray

A collection of audio summaries. See Table 14 AudioSummarys for details on the structure.

RiskLevel

String

high

The risk level, calculated from all audio slices. Valid values:

  • high: High Risk

  • medium: Medium Risk

  • low: Low Risk

  • none: no risk detected

SliceDetails

JSONArray

An array of objects, each detailing a transcribed audio slice (typically a single utterance). See Table 15 SliceDetails for details on the structure.

Table 14. Audio summaries

Parameter

Type

Value

Description

Label

String

profanity

Video and audio label.

LabelSum

Integer

8

Label count.

Table 15: SliceDetails

Parameter

Type

Example

Description

StartTime

Integer

0

The start time of the audio segment, in seconds.

EndTime

Integer

4065

The end time of the audio segment, in seconds.

StartTimestamp

Integer

1678854649720

The start timestamp of the segment, in milliseconds.

EndTimestamp

Integer

1678854649720

The end timestamp of the segment, in milliseconds.

Text

String

Disgusting

The transcribed text from the audio segment.

Url

String

https://aliyundoc.com/test.wav

A temporary URL to the audio segment file, returned for audio stream inputs. This URL expires after 30 minutes. You must save the file before it expires.

Labels

String

political_content,xxxx

The detected labels, separated by commas. Possible values include:

  • ad: Ad-related Promotion

  • violence: Violent and Terrorist Content

  • political_content: Politically Sensitive Content

  • specified_speaking: Specified Speaking

  • specified_lyrics: Specified Lyrics

  • sexual_content: Pornographic Content

  • sexual_sounds: Moaning

  • contraband: Contraband

  • profanity: Profanity

  • religion: Religious Content

  • cyberbullying: Cyberbullying

  • negative_content: Negative Content

  • nontalk: Muted Audio

  • C_customized: Matched in a user-defined library

RiskLevel

String

high

The risk level of the audio segment. Possible values include:

  • high: High risk

  • medium: Medium risk

  • low: Low risk

  • none: No risk detected

RiskWords

String

AAA,BBB,CCC

A comma-separated list of matched risk words.

RiskTips

String

sexual_content_vulgar_words,sexual_content_description

A comma-separated list of detailed labels.

Extend

String

{"riskTips":"sexual_content_vulgar_words","riskWords":"sexual_services"}

Reserved field.

Table 16. Extended Fields

Parameter

Type

Example value

Description

Result

String

aigc_byMeta

Indicates whether an AIGC implicit identifier was detected. Valid values:

  • aigc_byMeta: An AIGC implicit identifier is present.

  • none: No AIGC implicit identifier is present.

AigcData

Object

Returns the AIGC implicit identifier metadata from the video. For more information, see AigcData.

Table 17. AigcData

Parameter

Type

Example value

Description

AIGC

Object

"AIGC": {"Label": "1",

"ContentPropagator": "",

"ReservedCode1": "0424***",

"ProduceID": "0307***",

"ReservedCode2": "",

"PropagateID": "",

"ContentProducer": "0728***"}

Contains the AIGC implicit identifier metadata from the video. These fields align with the standard fields for AIGC metadata. For more information, see implicit identifier metadata.

Implicit identifier metadata

Parameter

Example value

Description

Label

1

Indicates whether the content is AI-generated:

  • 1: The content is AI-generated and synthesized.

  • 2: (propagation platform only) The content might be AI-generated and synthesized.

  • 3: (propagation platform only) The content is suspected of being AI-generated and synthesized.

ContentProducer

001191******M000100Y43

The code or name of the service provider, used to identify the content producer.

  • Required field

    • Digits 1-2: Format definition code, indicating the version of the encoding rules. For codes that follow this guide, this value is 00.

    • Digit 3: The entity type. 1 indicates an organization, and 2 indicates an individual.

    • Digit 4: A value of 1 indicates that the organization entity is bound to a Unified Social Credit Code.

    • Digits 5-22: The organization's Unified Social Credit Code.

  • Optional field

    • Digit 23: 1 for a generation and synthesis service, 2 for content propagation.

    • Digits 24-27: The service/model number (must be unique).

For more information, see the Cybersecurity Standard Practice Guide.

ProduceID

123456

The content production number. A unique identifier used by the production platform to trace the synthesized content.

ReservedCode1

d41d8cd98f00b204e9800998ecf8427e

A reserved field.

It can store information used by the generation and synthesis service provider for security and to ensure content and identifier integrity. A hash mechanism based on ContentProducer and ProduceID can be used to securely store and verify key information.

ContentPropagator

001191******M000100Y43

The name, number, or code of the propagation platform. For services that provide AI-generated and synthesized content, this can be the same as ContentProducer.

PropagateID

123456

The content propagation number. A unique identifier assigned by the propagation platform to propagated synthesized content.

ReservedCode2

d41d8cd98f00b204e9800998ecf8427e

A reserved field.

It can be used by the content propagation service provider for security and to ensure content and identifier integrity. A hash mechanism based on ContentPropagator and PropagateID can be used to securely store and verify key information.

Examples

Request example

{
    "Service": "videoDetection",
    "ServiceParameters": {
        "taskId": "abcd****"
    }
}

Successful response

  • Detect only video frames

{
    "Code": 200,
    "RequestId": "25106421-XXXX-XXXX-XXXX-15DA5AAAC546",
    "Message": "Success",
    "Data": {
        "DataId": "ABCDEF-TESTDATAID",
        "TaskId": "AAAAA-BBBBB-2024-0307-0728",
        "RiskLevel": "medium",
        "FrameResult": {
            "FrameNum": 2,
            "FrameSummarys": [
                {
                    "Label": "violent_explosion",
                    "Description": "May contain content related to fireworks or explosions.",
                    "LabelSum": 8
                },
                {
                    "Label": "sexual_cleavage",
                    "Description": "May contain sexually suggestive content or body exposure.",
                    "LabelSum": 8
                }
            ],
            "RiskLevel": "medium",
            "Frames": [
                {
                    "Offset": 1,
                    "RiskLevel": "none",
                    "Results": [
                        {
                            "Result": [
                                {
                                    "Label": "nonLabel",
                                    "Description": "No risks were detected."
                                }
                            ],
                            "Service": "baselineCheck"
                        },
                        {
                            "Result": [
                                {
                                    "Label": "nonLabel"
                                }
                            ],
                            "Service": "baselineCheck_pro"
                        }
                    ],
                    "TempUrl": "http://abc.oss-cn-shanghai.aliyuncs.com/test1.jpg"
                },
                {
                    "Offset": 2,
                    "RiskLevel": "medium",
                    "Results": [
                        {
                            "Result": [
                                {
                                    "Confidence": 74.1,
                                    "Label": "violent_explosion",
                                    "Description": "May contain content related to fireworks or explosions."
                                }
                            ],
                            "Service": "baselineCheck"
                        },
                        {
                            "Result": [
                                {
                                    "Confidence": 1,
                                    "Label": "sexual_cleavage",
                                    "Description": "May contain sexually suggestive content or body exposure."
                                }
                            ],
                            "Service": "baselineCheck_pro"
                        }
                    ],
                    "TempUrl": "http://abc.oss-cn-shanghai.aliyuncs.com/test2.jpg"
                }
            ]
        }
    }
}
  • Analyze video and audio

{
    "Code": 200,
    "RequestId": "ABCEDF-XXXX-XXXX-XXXX-202403070728520",
    "Message": "Success",
    "Data": {
        "DataId": "ABCDEF-TESTDATAID",
        "TaskId": "AAAAA-BBBBB-2024-0307-0728",
        "RiskLevel": "medium",
        "AudioResult": {
            "AudioSummarys": [
                {
                    "Label": "sexual_sounds",
                    "LabelSum": 3
                }
            ],
            "RiskLevel": "medium",
            "SliceDetails": [
                {
                    "EndTime": 60,
                    "EndTimestamp": 1698912813192,
                    "Labels": "",
                    "RiskLevel": "none",
                    "StartTime": 30,
                    "StartTimestamp": 1698912783192,
                    "Text": "AI Guardrails",
                    "Url": "http://abc.oss-cn-shanghai.aliyuncs.com/test.wav"
                },
                {
                    "EndTime": 30,
                    "EndTimestamp": 1698912813192,
                    "Extend": "{\"customizedWords\":\"service\",\"customizedLibs\":\"test\"}",
                    "Labels": "C_customized",
                    "RiskLevel": "high",
                    "StartTime": 0,
                    "StartTimestamp": 1698912783192,
                    "Text": "Welcome to the Alibaba Cloud AI Guardrails service",
                    "Url": "http://abc.oss-cn-shanghai.aliyuncs.com/test.wav"
                }
            ]
        },
        "FrameResult": {
            "FrameNum": 2,
            "FrameSummarys": [
                {
                    "Label": "violent_explosion",
                    "Description": "Suspected to contain firework-related content",
                    "LabelSum": 8
                },
                {
                    "Label": "sexual_cleavage",
                    "Description": "Suspected to contain nudity or sexually suggestive content",
                    "LabelSum": 8
                }
            ],
            "RiskLevel": "medium",
            "Frames": [
                {
                    "Offset": 1,
                    "RiskLevel": "none",
                    "Results": [
                        {
                            "Result": [
                                {
                                    "Label": "nonLabel",
                                    "Description": "No risks detected"
                                }
                            ],
                            "Service": "baselineCheck"
                        }
                    ],
                    "TempUrl": "http://abc.oss-cn-shanghai.aliyuncs.com/test1.jpg"
                },
                {
                    "Offset": 2,
                    "RiskLevel": "none",
                    "Results": [
                        {
                            "Result": [
                                {
                                    "Confidence": 1,
                                    "Label": "sexual_cleavage",
                                    "Description": "Suspected to contain nudity or sexually suggestive content"
                                },
                                {
                                    "Confidence": 74.1,
                                    "Label": "violent_explosion",
                                    "Description": "Suspected to contain firework-related content"
                                }
                            ],
                            "Service": "baselineCheck"
                        }
                    ],
                    "TempUrl": "http://abc.oss-cn-shanghai.aliyuncs.com/test2.jpg"
                }
            ]
        }
    }
}
  • When an AIGC implicit watermark is detected

{
    "Code": 200,
    "RequestId": "ABCEDF-XXXX-XXXX-XXXX-202403070728520",
    "Message": "Success",
    "Data": {
        "DataId": "ABCDEF-TESTDATAID",
        "TaskId": "AAAAA-BBBBB-2024-0307-0728",
        "Ext": {
            "AigcData": {
                "Result": "aigc_byMeta",
                "AIGC": {
                    "Label": "1",
                    "ContentPropagator": "",
                    "ReservedCode1": "0424***",
                    "ProduceID": "0307***",
                    "ReservedCode2": "",
                    "PropagateID": "",
                    "ContentProducer": "0728***"
                }
            }
        },
        "RiskLevel": "medium",
        "AudioResult": {
            "AudioSummarys": [
                {
                    "Label": "sexual_sounds",
                    "LabelSum": 3
                }
            ],
            "RiskLevel": "medium",
            "SliceDetails": [
                {
                    "EndTime": 60,
                    "EndTimestamp": 1698912813192,
                    "Labels": "",
                    "RiskLevel": "none",
                    "StartTime": 30,
                    "StartTimestamp": 1698912783192,
                    "Text": "Content Moderation",
                    "Url": "http://abc.oss-cn-shanghai.aliyuncs.com/test.wav"
                },
                {
                    "EndTime": 30,
                    "EndTimestamp": 1698912813192,
                    "Extend": "{\"customizedWords\":\"service\",\"customizedLibs\":\"test\"}",
                    "Labels": "C_customized",
                    "RiskLevel": "high",
                    "StartTime": 0,
                    "StartTimestamp": 1698912783192,
                    "Text": "Welcome to the Alibaba Cloud Content Moderation service",
                    "Url": "http://abc.oss-cn-shanghai.aliyuncs.com/test.wav"
                }
            ]
        },
        "FrameResult": {
            "FrameNum": 2,
            "FrameSummarys": [
                {
                    "Label": "nonLabel",
                    "Description": "No risk detected",
                    "LabelSum": 1
                },
                {
                    "Label": "aigc_byMeta",
                    "Description": "The image contains an AIGC implicit identifier",
                    "LabelSum": 1
                }
            ],
            "RiskLevel": "medium",
            "Frames": [
                {
                    "Offset": 1,
                    "RiskLevel": "none",
                    "Results": [
                        {
                            "Result": [
                                {
                                    "Label": "aigc_byMeta",
                                    "Description": "The image contains an AIGC implicit identifier"
                                }
                            ],
                            "Service": "aigcDetectorFull"
                        }
                    ],
                    "TempUrl": "http://abc.oss-cn-shanghai.aliyuncs.com/test1.jpg"
                },
                {
                    "Offset": 2,
                    "RiskLevel": "none",
                    "Results": [
                        {
                            "Result": [
                                {
                                    "Confidence": 1,
                                    "Label": "nonLabel",
                                    "Description": "No risk detected"
                                }
                            ],
                            "Service": "aigcDetectorFull"
                        }
                    ],
                    "TempUrl": "http://abc.oss-cn-shanghai.aliyuncs.com/test2.jpg"
                }
            ]
        }
    }
}
  • When auxiliary information is returned

{
    "Code": 200,
    "RequestId": "ABCEDF-XXXX-XXXX-XXXX-202403070728520",
    "Message": "success finished",
    "Data": {
        "DataId": "ABCDEF-TESTDATAID",
        "TaskId": "AAAAA-BBBBB-2024-0307-0728",
        "RiskLevel": "medium",
        "FrameResult": {
            "FrameNum": 1,
            "FrameSummarys": [
                {
                    "Label": "logo_brand_lib",
                    "Description": "Trademark_custom library match",
                    "LabelSum": 1
                }
            ],
            "RiskLevel": "medium",
            "Frames": [
                {
                    "Offset": 1,
                    "RiskLevel": "medium",
                    "Results": [
                        {
                            "CustomImage": [
                                {
                                    "LibId": "303074761XXXX",
                                    "ImageId": "94XXXX"
                                }
                            ],
                            "Service": "postImageCheckByVL",
                            "Result": [
                                {
                                    "Description": "Trademark_custom library match",
                                    "Confidence": 84.97,
                                    "Label": "logo_brand_lib"
                                }
                            ],
                            "TextInImage": {
                                "OcrDatas": [
                                    "Great Wall ORA"
                                ]
                            },
                            "PublicFigure": [
                                {
                                    "FigureId": "3647ca8a",
                                    "FigureName": "XXX",
                                    "Location": [
                                        {
                                            "W": 33,
                                            "H": 42,
                                            "X": 199,
                                            "Y": 288
                                        }
                                    ]
                                }
                            ],
                            "LogoData": [
                                {
                                    "Logo": [
                                        {
                                            "confidence": 85.17,
                                            "name": "VOLVO",
                                            "label": "logo_brand"
                                        }
                                    ],
                                    "Location": {
                                        "W": 175,
                                        "X": 151,
                                        "H": 174,
                                        "Y": 192
                                    }
                                }
                            ],
                            "VlContent": {
                                "OutputText": "Political, other. Military/police uniforms, minors, other flags, politically sensitive locations."
                            }
                        }
                    ],
                    "TempUrl": "http://abc.oss-cn-shanghai.aliyuncs.com/test1.jpg"
                }
            ]
        }
    }
}

Code

This topic explains the Code values returned by the video file auditing enhanced edition API. Only requests that return a Code of 200 or 280 are subject to metering and billing; you are not charged for any other requests.

Code

Description

200

The request was successful or the detection is complete.

280

The detection is in progress.

288

The task is queued in near-line mode.

400

The request is missing one or more required parameters.

401

The request contains an invalid parameter. Verify the parameter format and try again.

402

The length of a request parameter exceeds the API limit. Check the parameter length and try again.

403

The request rate has exceeded the QPS limit. Check and adjust your concurrency.

404

Failed to download the video. Check the video URL and try again.

405

The video download timed out. The video may be inaccessible. Check the video URL and your network settings, then try again.

406

The video size exceeds the allowed limit. Reduce the video size and try again.

407

The video format is not supported. Convert the video to a supported format and try again.

408

The account lacks permission to call this API. This error can occur if the service is not enabled, the account has an overdue payment, or the account lacks authorization.

409

The specified TaskId does not exist, which can happen if the result has expired. Results have a validity period of 24 hours.

480

The number of concurrent detection streams has exceeded the limit. Check and adjust your concurrency settings.

500

A system error occurred. Please try again later. If the problem persists, contact support.