logo
Voice Call
Server API
Stream Mixing and Transcoding APIs
On this page

StartCensorVideoV2

POST

https://rtc-api.zego.im/

Video stream moderation is an interactive extension service of ZEGOCLOUD's real-time audio/video products. Through the video stream moderation API, developers can invoke real-time video moderation to moderate audio and video content, including audio semantics and features (pitch, timbre, voiceprint, melody, etc.) recognition, and text semantics and content recognition in video frames. ZEGOCLOUD will send the recognition results to developers through video stream moderation callback or a configured custom callback URL. The start video stream moderation feature should be used in conjunction with stop video stream moderation.

Warning

Before using this API, please refer to Console - Cloud Market - Shumei Content Moderation and follow the on-page instructions to enable the relevant permissions for Shumei Content Moderation.

Rate Limit
For all rooms under the same AppID: 100 times/second

FAQ

  1. What happens if I start audio/video stream moderation API but don't call the stop audio/video stream moderation API?

    It will automatically end after pulling an empty stream for about 5 minutes. It is recommended to actively call the API to end moderation when you finish moderating.

  2. How do I identify which stream violated the rules in the audio/video stream moderation result callback?

    After completing moderation, ShuMei will return multiple callbacks based on 10s audio segment AudioUrls. The current results do not directly expose streamID information, but you can obtain it by extracting information from resultTaskId.

    Example (assuming streamID is 0001, you can see that AudioUrl contains streamID 0001):

Request

Query Parameters

    Action stringrequired

    Possible values: [StartCensorVideoV2]

    API prototype parameters

    https://rtc-api.zego.im?Action=StartCensorVideoV2

    AppId uint32required

    💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.

    SignatureNonce stringrequired

    💡Common parameter. A 16-character hexadecimal random string (hex-encoded 8-byte random number). For the generation algorithm, refer to the signature example.

    Timestamp int64required

    💡Common parameter. Current Unix timestamp in seconds. For the generation algorithm, refer to the signature example. A maximum deviation of 10 minutes is allowed.

    Signature stringrequired

    💡Common parameter. Signature used to verify the legitimacy of the request. Please refer to the signature mechanism to generate it.

    SignatureVersion stringrequired

    Possible values: [2.0]

    Default value: 2.0

    💡Public parameter. Signature version number.

Body

required
    RoomId stringrequired

    Room ID of the video moderation to be performed. By default, all streams in the room will be submitted for moderation. If there are streams in the room that do not need moderation (such as streams published by trusted users), please set 'ZegoPulisherConfig.streamCensorshipFlag' to not allow moderation when calling the client SDK's 'startPublishingStream' to publish streams.

    EventId stringrequired

    Scenario identifier.

    Use this parameter to identify the scenario corresponding to the audio stream. Moderation policies can be adjusted based on scenarios, thereby achieving control over moderation strictness for different scenarios.

    • Live streaming: live_streaming
    • 1v1: private_chat

    If the above optional values cannot fully meet your requirements, please contact ZEGOCLOUD Technical Support.

    Language string

    Possible values: [zh, en, ar, hi, es, fr, ru, pt, id, de, ja, tr, vi, it, th, tl, ko, ms]

    Default value: zh

    Optional, language type. Specifies the language type for text content detection in video frames and audio segments (default is Chinese).

    • zh: Chinese (default)
    • en: English
    • ar: Arabic
    • hi: Hindi
    • es: Spanish
    • fr: French
    • ru: Russian
    • pt: Portuguese
    • id: Indonesian
    • de: German
    • ja: Japanese
    • tr: Turkish
    • vi: Vietnamese
    • it: Italian
    • th: Thai
    • tl: Filipino
    • ko: Korean
    • ms: Malay
    AudioParam object
    Audio parameters. If not passed, audio streams will not be moderated
    RiskTypeList string[]

    Risk moderation category.

    At least one of RiskTypeList and BusinessTypeList must not be empty. If both are empty, audio will not be moderated, only video. Values that can be added to the array are as follows: Audio semantics:

    • EROTIC: Pornography
    • DIRTY: Abuse
    • POLITY: Politics
    • BAN: Prohibited
    • VIOLENT: Violence/Terrorism
    • ADVERT: Advertisement

    Audio features:

    • MOAN: Moaning
    • ANTHEN: National anthem recognition
    • BANEDAUDIO: Prohibited songs

    For other features, please contact ZEGOCLOUD Technical Support.

    BusinessTypeList string[]

    Business recognition category.

    At least one of RiskTypeList and BusinessTypeList must not be empty. If both are empty, audio will not be moderated, only video. Values that can be added to the array are as follows: Audio semantics:

    • MOINIR: Minors

    Audio features:

    • SING: Singing
    • LANGUAGE: Language recognition
    • VOICE: Voice attribute recognition

    For other features, please contact ZEGOCLOUD Technical Support. Audio stream recognition is not limited to violating content, but can also assist developers in business operations. If the above optional values cannot meet your business requirements, please contact ZEGOCLOUD Technical Support.

    AudioLanguage stringdeprecated

    Possible values: [zh, ja, ko, th, vi, ms, tl, id, hi, ar, tr, en, es, pt, it, fr, de, ru]

    This parameter has been deprecated. Please use the Language parameter instead.

    ReturnAllText int32

    Possible values: [0, 1]

    Default value: 0

    Whether to return all text of the current 10s segment:

    • 0: (Default) Return audio segment text with risk level other than PASS
    • 1: Return audio segment text of all risk levels

    The risk levels of moderation results will be divided into the following three categories:

    PASS: Normal content, recommended to allow directly.

    REVIEW: Suspicious content, recommended for manual review.

    REJECT: Violating content, recommended to block directly.

    ReturnPreText int32

    Possible values: [0, 1]

    Default value: 0

    Whether to return the text of the previous 10s segment of the violating segment:

    • 0: (Default) Do not return the text of the previous 10s segment of the violating segment
    • 1: Return the text of the previous 10s segment of the violating segment
    ReturnPreAudio int32

    Possible values: [0, 1]

    Default value: 0

    Whether to return the previous audio segment link of the violating segment:

    • 0: (Default) Do not return the previous 10s segment audio of the violating segment, only return the violating segment audio link
    • 1: Return the previous 10s segment audio link of the violating segment
    ResultCallbackUrl string

    Custom callback URL for moderation results.

    If you need to send moderation results for this moderation task through another callback URL, you can use this parameter. If not needed, you can configure a unified callback URL in the ZEGOCLOUD Console. For details, please refer to Console - Cloud Market - Shumei Content Moderation.

    StatusCallbackUrl string

    Custom callback URL for moderation status.

    If you need to send moderation status for this moderation task through another callback URL, you can use this parameter. If not needed, you can configure a unified callback URL in the ZEGOCLOUD backend. For details, please refer to Console - Cloud Market - Shumei Content Moderation.

    VideoParam objectrequired
    Video moderation related parameters
    RiskTypeList string[]

    Risk moderation category.

    At least one of RiskTypeList and BusinessTypeList must not be empty. Values that can be added to the array are as follows:

    Text semantics in video frames:

    • IMGTEXTRISK: Basic violation recognition, including multiple common tags (politics, violence/terrorism, prohibited, pornography, abuse, advertisement, spam privacy, advertising law)

    Video content:

    • POLITY: Politics
    • EROTIC: Pornography, sexy
    • VIOLENT: Violence/Terrorism, prohibited
    • QRCODE: QR code
    • ADVERT: Advertisement

    If the above optional values cannot meet your business requirements, please contact ZEGOCLOUD Technical Support.

    BusinessTypeList string[]

    Business recognition category.

    At least one of RiskTypeList and BusinessTypeList must not be empty. Values that can be added to the array:

    Video content:

    • AGE: Minors
    • PHOTOMATERIALLOGO: CFP and other copyright LOGOs, also supports more than a dozen other LOGOs. Please contact technical support for details.

    Video content extensions:

    • FACEDETECTION: Face detection
    • BEAUTY: Beauty score

    Video stream recognition is not limited to violating content, but can also assist developers in business operations. If the above optional values cannot meet your business requirements, please contact ZEGOCLOUD Technical Support.

    ReturnAllImg int32

    Possible values: [0, 1]

    Default value: 0

    Risk level for video frame capture, recommended to pass 1:

    • 0: (Default) Return frame capture moderation information with risk level other than PASS
    • 1: Return frame capture moderation information of all risk levels

    The risk levels of moderation results will be divided into the following three categories:

    • PASS: Normal content, recommended to allow directly
    • REVIEW: Suspicious content, recommended for manual review
    • REJECT: Violating content, recommended to block directly
    DetectFrequency int32

    Frame capture frequency. Unit: seconds. Default is 3s, capture one frame for moderation.

    ResultCallbackUrl string

    Custom callback URL for moderation results.

    If you need to send moderation results for this moderation task through another callback URL, you can use this parameter. If not needed, you can configure a unified callback URL in the ZEGOCLOUD Console. For details, please refer to Console - Cloud Market - Shumei Content Moderation.

    StatusCallbackUrl string

    Custom callback URL for moderation status.

    If you need to send moderation status for this moderation task through another callback URL, you can use this parameter. If not needed, you can configure a unified callback URL in the ZEGOCLOUD backend. For details, please refer to Console - Cloud Market - Shumei Content Moderation.

    ReturnFinishInfo int32

    Possible values: [0, 1]

    Default value: 0

    When the moderation task ends, whether to perform a "moderation task status" callback:

    • 0: Do not send end notification when moderation ends
    • 1: Send end notification when moderation ends

Responses

Success
Schema
    Code int32

    Return code. The following only lists some return codes related to the API business logic. For complete return codes, please refer to Global Return Codes.

    Return CodeDescriptionSuggested Action
    50006、50007HTTP request failed.Please retry later (recommended 300s), or contact ZEGOCLOUD Technical Support.
    50009Moderation failed.Please retry later (recommended 300s), or contact ZEGOCLOUD Technical Support.
    50117Configuration error, ShuMei permissions not enabled.Please refer to Console - Cloud Market - Shumei Content Moderation and follow the on-page instructions to enable `Shumei Content Moderation` permissions.
    Message string

    Operation result description

    RequestId string

    Request ID

    Data object
    Response data
    TaskId string

    Moderation task ID, used to end the moderation task

Previous

StopCensorAudioV2

Next

StopCensorVideoV2

On this page

Back to top