API | Description |
Submits a video moderation job. | |
Queries the result of the specified video moderation job. |
QCloudPostVideoRecognitionRequest
) is used to submit a video moderation job. You can receive the moderation result by setting the callback address or querying by JobId
.QCloudPostVideoRecognitionRequest * request = [[QCloudPostVideoRecognitionRequest alloc]init];// Object key, i.e., the full path of a COS object. If the object is in a directory, the path should be "dir1/object1".request.object = @"exampleobject";// File regionrequest.regionName = @"regionName";// Bucket name in the format of BucketName-APPIDrequest.bucket = @"examplebucket-1250000000";// Moderation type, such as `porn` (pornography) and `ads` (advertising).// You can select multiple types; for example, `detect-type=porn,ads` indicates to moderate the image for pornographic and advertising information.// You can use multiple parameters together, such as `QCloudRecognitionPorn | QCloudRecognitionTerrorist`.request.detectType = QCloudRecognitionPorn | QCloudRecognitionAds;// 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.request.mode = QCloudVideoRecognitionModeFps;// Video frame capturing frequency. Value range: (0.000, 60.000] seconds. The value supports the float format, accurate to the millisecond.request.timeInterval = 1;// The number of captured frames. Value range: (0, 10000].request.count = 10;// Moderation policy. If this parameter is not specified, the default policy will be used. For more information, visit https://www.tencentcloud.com/document/product/460/56345?from_cn_redirect=1.request.bizType = @"BizType";// Specify whether to moderate video sound. Valid values: `0` (moderates the video image only), `1` (moderates both the video image and video sound). Default value: `0`.request.detectContent = YES;request.finishBlock = ^(QCloudPostVideoRecognitionResult * outputObject, NSError *error) {// The moderation result `outputObject` contains the job ID used for query. For detailed fields, see the API documentation or SDK source code.// `QCloudPostVideoRecognitionResult` class};[[QCloudCOSXMLService defaultCOSXML] PostVideoRecognition:request];
let request : QCloudPostVideoRecognitionRequest = QCloudPostVideoRecognitionRequest();// Object key, i.e., the full path of a COS object. If the object is in a directory, the path should be "dir1/object1".request.object = "exampleobject";// File regionrequest.regionName = "regionName";// Bucket name in the format of BucketName-APPIDrequest.bucket = "examplebucket-1250000000";// Moderation type, such as `porn` (pornography) and `ads` (advertising).// You can select multiple types; for example, `detect-type=porn,ads` indicates to moderate the image for pornographic and advertising information.// You can use multiple parameters together, such as `QCloudRecognitionPorn | QCloudRecognitionTerrorist`.request.detectType = QCloudRecognitionEnum(rawValue: QCloudRecognitionEnum.porn.rawValue | QCloudRecognitionEnum.ads.rawValue!// 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.request.mode = QCloudVideoRecognitionMode.fps;// Video frame capturing frequency. Value range: (0.000, 60.000] seconds. The value supports the float format, accurate to the millisecond.request.timeInterval = 1;// The number of captured frames. Value range: (0, 10000].request.count = 10;// Moderation policy. If this parameter is not specified, the default policy will be used. For more information, visit https://www.tencentcloud.com/document/product/460/56345?from_cn_redirect=1.request.bizType = "BizType";// Specify whether to moderate video sound. Valid values: `0` (moderates the video image only), `1` (moderates both the video image and video sound). Default value: `0`.request.detectContent = true;request.finishBlock = { (result, error) in// The moderation result `outputObject` contains the job ID used for query. For detailed fields, see the API documentation or SDK source code.// `QCloudPostVideoRecognitionResult` class}QCloudCOSXMLService.defaultCOSXML().postVideoRecognition(request);
QCloudGetVideoRecognitionRequest
) is used to query the result of the specified video moderation job by job ID.QCloudGetVideoRecognitionRequest * request = [[QCloudGetVideoRecognitionRequest alloc]init];// Bucket name in the format of BucketName-APPIDrequest.bucket = @"examplebucket-1250000000";// The `jobid` returned by the `QCloudPostVideoRecognitionRequest` APIrequest.jobId = @"jobid";[request setFinishBlock:^(QCloudVideoRecognitionResult * _Nullable result, NSError * _Nullable error) {// The moderation result `outputObject` contains the job ID used for query. For detailed fields, see the API documentation or SDK source code.// `QCloudVideoRecognitionResult` class}];[[QCloudCOSXMLService defaultCOSXML] GetVideoRecognition:request];
let request : QCloudGetVideoRecognitionRequest = QCloudGetVideoRecognitionRequest();// Bucket name in the format of BucketName-APPIDrequest.bucket = "examplebucket-1250000000";// The `jobid` returned by the `QCloudPostVideoRecognitionRequest` APIrequest.jobId = "jobid";request.finishBlock = { (result, error) in// The moderation result `outputObject` contains the job ID used for query. For detailed fields, see the API documentation or SDK source code.// `QCloudVideoRecognitionResult` class}QCloudCOSXMLService.defaultCOSXML().getVideoRecognition(request);
Was this page helpful?