tencent cloud

Cloud Object Storage

最新情報とお知らせ
製品アップデート情報
製品のお知らせ
製品概要
製品概要
機能概要
応用シナリオ
製品の優位性
基本概念
リージョンとアクセスドメイン名
仕様と制限
製品の課金
課金概要
課金方式
課金項目
無料利用枠
記帳例
請求書の確認とダウンロード
お支払い遅れについて
よくある質問
クイックスタート
コンソールクイックスタート
COSBrowserクイックスタート
ユーザーガイド
リクエストの作成
バケット
オブジェクト
データ管理
バッチ処理
グローバルアクセラレーション
監視とアラーム
運用管理センター
データ処理
インテリジェントツールボックス使用ガイド
データワークフロー
アプリ統合
ツールガイド
ツール概要
環境のインストールと設定
COSBrowserツール
COSCLIツール
COSCMDツール
COS Migrationツール
FTP Serverツール
Hadoopツール
COSDistCpツール
HDFS TO COSツール
オンラインツール (Onrain Tsūru)
セルフ診断ツール
実践チュートリアル
概要
アクセス制御と権限管理
パフォーマンスの最適化
AWS S3 SDKを使用したCOSアクセス
データディザスタリカバリバックアップ
ドメイン名管理の実践
画像処理の実践
COSオーディオビデオプレーヤーの実践
データセキュリティ
データ検証
COSコスト最適化ソリューション
サードパーティアプリケーションでのCOSの使用
移行ガイド
サードパーティクラウドストレージのデータをCOSへ移行
データレークストレージ
クラウドネイティブデータレイク
メタデータアクセラレーション
データアクセラレーター GooseFS
データ処理
データ処理概要
画像処理
メディア処理
コンテンツ審査
ファイル処理
ドキュメントプレビュー
トラブルシューティング
RequestId取得の操作ガイド
パブリックネットワーク経由でのCOSへのファイルアップロード速度の遅さ
COSへのアクセス時に403エラーコードが返される
リソースアクセス異常
POST Objectの一般的な異常
セキュリティとコンプライアンス
データ災害復帰
データセキュリティ
クラウドアクセスマネジメント
よくある質問
よくあるご質問
一般的な問題
従量課金に関するご質問
ドメインコンプライアンスに関するご質問
バケット設定に関する質問
ドメイン名とCDNに関するご質問
ファイル操作に関するご質問
権限管理に関するご質問
データ処理に関するご質問
データセキュリティに関するご質問
署名付きURLに関するご質問
SDKクラスに関するご質問
ツール類に関するご質問
APIクラスに関するご質問
Agreements
Service Level Agreement
プライバシーポリシー
データ処理とセキュリティ契約
連絡先
用語集
ドキュメントCloud Object Storage

Video Moderation

フォーカスモード
フォントサイズ
最終更新日: 2024-02-02 12:12:58

Overview

This document describes how to use the content moderation feature provided by Cloud Infinite (CI). CI fully integrates the processing capabilities with the COS SDK.
Note:
To use the content moderation service, you need to have the permission to use CI:
For root accounts, click here for role authorization.
This document provides an overview of APIs and SDK code samples for video moderation.
API
Description
Submits video moderation job.
Queries the result of specified video moderation job.

Submitting Video Moderation Job

Feature description

This API is used to submit a video moderation job.

Method prototype

CosResult CreateVideoAuditingJob(const CreateVideoAuditingJobReq& req, CreateVideoAuditingJobResp* resp);

Sample request

qcloud_cos::CosConfig config("./config.json");
qcloud_cos::CosAPI cos(config);
std::string bucket_name = "examplebucket-1250000000";
std::string object_name = "test.mp4";

CreateVideoAuditingJobReq req(bucket_name);
CreateVideoAuditingJobResp resp;

// Add request parameters as detailed in the API documentation
req.SetObject(object_name);
req.SetBizType("b81d45f94b91a683255e9a9506f45a11");
// req.SetDetectType("Porn,Ads");
SnapShotConf snap_shot = SnapShotConf();
snap_shot.SetCount(100);
snap_shot.SetMode("Interval");
snap_shot.SetTimeInterval(10);
req.SetSnapShot(snap_shot);

// Call the API to get the job response object
CosResult result = cos.CreateVideoAuditingJob(req, &resp);
if (result.IsSucc()) {
// If the moderation job is created successfully, you can call the member functions of `CreateVideoAuditingJobResp`.
} else {
// If the moderation job failed to be created, you can call the member functions of `CosResult` to output the error message.
}

Parameter description

Parameter
Description
Type
Required
req
CreateVideoAuditing operation request
CreateVideoAuditingReq
Yes
resp
CreateVideoAuditing operation response
CreateVideoAuditingResp
Yes
CreateVideoAuditingReq provides the following member functions:
// Set the bucket for performing the operation
void SetBucketName(const std::string& bucket_name);
// Set the input video to be moderated
void SetInput(const AuditingInput& input);
// Set moderation configuration rules
void SetConf(const Conf& conf);

// conf
// 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 porn, adverting, and illegal information. For configuration guides, see [Setting Moderation Policy](https://www.tencentcloud.com/document/product/436/52095).
// 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.
void SetBizType(const std::string& biz_type);
// The scene to be moderated, such as `Porn` (pornography) and `Ads` (advertising). You can pass in multiple types and separate them by comma, such as `Porn,Ads`. If you need to moderate more scenes, use the `BizType` parameter.
void SetDetectType(const std::string& detect_type);
// Video image moderation is implemented by taking a certain number of screenshots based on the video frame capturing capability and then moderating the screenshots one by one. This parameter is used to specify the configuration of video frame capturing.
void SetSnapShot(const SnapShotConf& snap_shot);
// Callback address, which must start with `http://` or `https://`.
void SetCallBack(const std::string& callback);
// Structure of the callback content. Valid values: `Simple` (the callback content contains basic information), `Detail` (the callback content contains detailed information). Default value: `Simple`.
void SetCallBackVersion(const std::string& callback_version);
// 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`.
void SetDetectContent(const int detect_content);

// input
// Name of the video file stored in the COS bucket; for example, if the file is `video.mp4` in the `test` directory, then the filename is `test/video.mp4`.
void SetObject(const std::string& object);
// Full URL of the video file, such as `http://examplebucket-1250000000.cos.ap-shanghai.myqcloud.com/test.mp4`. Either `Object` or `Url` can be selected at a time.
void SetUrl(const std::string& url);
// 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.
void SetDataId(const std::string& data_id);
// Business field.
void SetUserInfo(const UserInfo& user_info);
CreateVideoAuditingResp provides the following member functions:
// Get the job details returned by the API request
VideoAuditingJobsDetail GetJobsDetail();
// Get the `RequestId` returned by the API
std::string GetRequestId();


Response description

Success: The moderation job result in the XML content returned by the API will be parsed into the VideoAuditingJobsDetail structure. For specific response parameters, see Submitting Video Moderation Job.
Failure: If an error (for example, the bucket does not exist) occurs, the error message will be parsed into the CosResult structure. For more information, see Troubleshooting.

Querying Video Moderation Job Result

Feature description

This API is used to query the status and result of a video moderation job.

Method prototype

CosResult DescribeVideoAuditingJob(const DescribeVideoAuditingJobReq& req, DescribeVideoAuditingJobResp* resp);

Sample request

qcloud_cos::CosConfig config("./config.json");
qcloud_cos::CosAPI cos(config);
std::string bucket_name = "examplebucket-1250000000";

DescribeVideoAuditingJobReq req(bucket_name);
DescribeVideoAuditingJobResp resp;

// Add request parameters as detailed in the API documentation
req.SetJobId("vab1ca9fc8a3ed11ea834c525400863904");

// Call the API to get the job response object
CosResult result = cos.DescribeVideoAuditingJob(req, &resp);
if (result.IsSucc()) {
// If the moderation job is queried successfully, you can call the member functions of `DescribeVideoAuditingJobResp`.
} else {
// If the moderation job failed to be queried, you can call the member functions of `CosResult` to output the error message.
}

Parameter description

Parameter
Description
Type
Required
req
DescribeVideoAuditingJob operation request
DescribeVideoAuditingJobReq
Yes
resp
DescribeVideoAuditingJob operation response
DescribeVideoAuditingJobResp
Yes
DescribeVideoAuditingJobReq provides the following member functions:
// Set the bucket for performing the operation
void SetBucketName(const std::string& bucket_name);
// Set the ID of the moderation job to be queried
void SetJobId(const std::string& job_id);
DescribeVideoAuditingJobResp provides the following member functions:
// Get the job details returned by the API request
VideoAuditingJobsDetail GetJobsDetail();
// Get the `RequestId` returned by the API
std::string GetRequestId();


Response description

Success: The moderation job result in the XML content returned by the API will be parsed into the VideoAuditingJobsDetail structure. For specific response parameters, see Submitting Video Moderation Job.
Failure: If an error (for example, the bucket does not exist) occurs, the error message will be parsed into the CosResult structure. For more information, see Troubleshooting.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック