This page introduces how to use Hive Visual Moderation API in Agora SDK to empower your app with accurate content moderation for live video streams.
Hive Visual Moderation API and Agora SDK work together as follows:
enableContentInspect
is called, Agora SDK takes screenshots of the local user's video and uploads the screenshots to the Agora server.enableContentInspect
.To use Hive Visual Moderation API in Agora SDK, you need to call the enableContentInspect
method.
You can use the following sample code:
Android
ContentInspectConfig config = new ContentInspectConfig();
config.extraInfo = "try Hive";
config.moduleCount = 1;
config.modules[0].type = ContentInspectConfig.CONTENT_INSPECT_TYPE_MODERATION; // Be sure to set type as MODERATION
config.modules[0].interval = 2; // Set content moderation to run every 2 seconds
mRtcEngine.enableContentInspect(true, config);
iOS
let inspectExtraConfig = AgoraContentInspectConfig()
inspectExtraConfig.extraInfo = "try Hive "
var modules = [AgoraContentInspectModule]()
let module = AgoraContentInspectModule()
module.type = .moderation // Be sure to set type as moderation
module.interval = 2 // Set content moderation to run every 2 seconds
modules.append(module)
inspectExtraConfig.modules = modules
agoraKit.enableContentInspect(true, config:inspectExtraConfig)
After Agora server sends the screenshots to Hive, Hive returns the results to your callback URL in the form of an HTTP response. For full details, see Hive response formats.
Your email must include the following information:
Name | Description |
---|---|
AppId | Agora App ID |
desc | (Optional) Description of your project |
callback_url | Your callback URL to receive classification results from Hive |
moderation_upload_policy | Set it to one of the following: |
oss_vendor | (Optional) If moderation_upload_policy is not [""], set it to "aws" or "aliyun", and provide your OSS configuration (see below). |
OSS configuration
Key | Description |
---|---|
aws_oss_access_key_id | AWS AccessKeyId |
aws_oss_access_key_secret | AWS AccessKeySecret |
aws_oss_bucket_name | AWS bucket name. See Bucket |
aws_oss_endpoint | AWS endpoint. See Endpoint |
aws_oss_fileName_prefix | Bucket folder path prefix delimited by "/" |
aws_oss_region | AWS region. See Region |
Key | Description |
---|---|
aliyun_oss_access_key_id | Aliyun AccessKeyId |
aliyun_oss_access_key_secre | Aliyun AccessKeySecret |
aliyun_oss_bucket_name | Aliyun OSS bucket name. See Bucket |
aliyun_oss_endpoint | Aliyun endpoint. See Endpoint |
aliyun_oss_fileName_prefix | Bucket folder path prefix delimited by "/" |
The following is an example of the configuration e-mail:
Title:
Hive Extension Activation Request
Body:
AppId: 12345678
desc: Video conference moderation results
callback_url: https://webhook.site/moderation-results
moderation_upload_policy: ["porn", "sexy"]
oss_vendor: aws
aws_oss_access_key_id: 12345678
aws_oss_access_key_secret: abcd123
aws_oss_bucket_name: moderated-pictures
aws_oss_endpoint: s3.cn-north-1.amazonaws.com.cn
aws_oss_region: cn-north-1
aws_oss_fileName_prefix: compliance/content-moderation/