API | Description |
Submits a video moderation job. | |
Queries the result of a specified video moderation job. |
"""Test the CI's API for moderating video file content"""# Create a COS client# Recognize a video in COSresponse = client.ci_auditing_video_submit(Bucket='bucket',DetectType=CiDetectType.PORN | CiDetectType.ADS,Key='test.mp4')print response
ci_auditing_video_submit
function is called. Specific request parameters are as follows:Parameter | Description | Type | Required |
Bucket | Bucket name. | String | Yes |
Key | Object name, such as picture.jpg . | String | Yes |
BizType | Unique identifier of the moderation policy. You can configure the scenes you want to moderate on the moderation policy page in the console, such as pornographic, adverting, and illegal information. For configuration guidelines, see Setting Public Moderation Policy. You can get BizType in the console. If BizType is specified, the moderation request will perform moderation based on the scenes configured in the moderation policy. If BizType is not specified, the default moderation policy will be used automatically. | String | No |
DetectType | Moderation type. Valid values: CiDetectType.PORN (pornography), CiDetectType.ADS (advertising). You can select multiple types. For example, CiDetectType.PORN | CiDetectType.ADS indicates to moderate the video for pornographic and advertising information. If you need more moderation scenes, use the BizType parameter. | enum | No |
Url | A video URL that is not in COS can be directly used for moderation. | String | No |
Callback | Callback address, which must start with http:// or https:// . | String | No |
CallbackVersion | Structure of the callback content. Valid values: Simple (the callback content contains basic information), Detail (the callback content contains detailed information). Default value: Simple . | String | No |
Mode | Frame capturing mode. Valid values: Interval (interval mode), Average (average mode), Fps (fixed frame rate mode). Interval mode: The TimeInterval and Count parameters take effect. If Count is set but TimeInterval is not, all frames will be captured to generate a total of Count images. Average mode: The Count parameter takes effect, indicating to capture a total of Count images at an average interval in the entire video.Fps mode: TimeInterval indicates how many frames to capture per second, and Count indicates how many frames to capture in total. | String | No |
Count | Number of captured frames. Value range: (0, 10000]. | String | No |
TimeInterval | Video frame capturing frequency. Value range: (0, 60] seconds. The value supports the float format, accurate to the millisecond. | String | No |
UserInfo | Business field. For details on parameters that can be passed in, see the UserInfo field in Submitting Video Moderation Job. | Dict | No |
DataId | This field will return the original content in the moderation result, which can contain up to 512 bytes. You can use this field to uniquely identify the data to be moderated in your business. | String | No |
ci_auditing_video_submit
function will convert the XML returned in the API into a dict
value. For specific response parameters, see Submitting Video Moderation Job."""Test the CI's API for querying moderation job result"""# Create a COS client# Query the moderation resultresponse = client.ci_auditing_video_query(Bucket='bucket',JobID='v11122zxxxazzz')print response
ci_auditing_video_query
function is called. Specific request parameters are as follows:Parameter | Description | Type | Required |
Bucket | Bucket name. | String | Yes |
JobID | Moderation job ID. | String | Yes |
ci_auditing_video_query
function will convert the XML returned in the API into a dict
value. For specific response parameters, see Querying Video Moderation Job Result.
Was this page helpful?