CSS Screencapturing & Porn Detection

Last updated: 2021-09-18 16:38:10

    CSS provides screencapture and porn detection. After you configure a screencapture and porn detection template in the console and bind it with a push domain name, CSS takes screenshots of the live stream and stores them or porn detection data into Cloud Object Storage (COS). After the push domain name has been bound with a callback template, if a callback event is triggered during live streaming, Tencent Cloud will send a request to the client server which is responsible for the response. After passing the verification, the server will obtain a JSON packet containing the porn detection callback.
    This document describes how to create, bind, unbind, modify, and delete a screencapture and porn detection template in the console.

    You can create a screencapture and porn detection template in the following ways:

    Notes

    • You can enable screencapture directly. To enable porn detection, you must enable screencapture first.
    • Using screencapture and porn detection will incur fees. The unit prices for screencapture and porn detection are 0.0176 USD per thousand screenshots and 0.2294 USD per thousand screenshots respectively. For details, see Intelligent Porn Detection.
    • The generated screenshots will be stored in your COS bucket and will incur COS storage fees. For more information, see COS Pricing.
    • To enable the screencapture feature, you must first grant CSS the permission to write to your COS bucket. For more information, see Authorizing CSS to Store Screenshots in a COS Bucket.
    • After creating a template, you can bind it with a push domain name. For more information, see Screencapture and Porn Detection Configuration. The binding takes effect in about 5-10 minutes.
    • In the console, you can manage screencapture and porn detection templates by domain name, but cannot cancel rules created by APIs. If you have bound a template with a specified stream through screencapture and porn detection APIs and want to unbind them, you need to call the DeleteLiveSnapshotRule API.
    • Binding, unbinding, or modifying a template affects only new live streams after the update but not ongoing ones. To make the new rule take effect for ongoing live streams, you need to interrupt them and push them again.

    Prerequisites

    Creating a Screencapture and Porn Detection Template

    1. Log in to the CSS console, and select Feature Configuration > **Live Screencapture & Porn Detection.
    2. Click Create Screencapture and Porn Detection Template, configure settings, and then click Save.
      Configuration ItemDescription
      Template Name The name of the screencapture and porn detection template, which can contain up to 30 letters, digits, underscores (_), and hyphens (-).
      Template Description The description of the screencapture and porn detection template, which can contain up to 100 letters, digits, underscores (_), and hyphens (-).
      Screencapture Interval Auto screencapture interval during the push, in seconds. Value range: 2 (default)-300 Intelligent Porn Detection Whether to enable intelligent porn detection. If it is enabled, you need to configure a callback template before you can receive porn detection results.
      Storage Account You can select **Current Account** or **Other Account**.
      CosAppId Required only when the storage account (the account where the COS service is under) is set to **Other Account**. You can get the value of the `AppId` in **Account Information** of the storage account.
      Bucket Select a **COS** bucket that you have created and authorized.
      Region The region where the bucket resides in. It cannot be modified.
      Folder Click the box to select a COS folder. The folder name is in the format of {Year}-{Month}-{Day}/ by default.
      Note: the name of a COS folder can contain only letters, digits, placeholders, and symbols -, !, _, ., *.
      File Name The format of the screenshot file name. Default format: {StreamID}-screenshot-{Hour}-{Minute}-{Second}-{Width}x{Height}{Ext}. It can be customized by splicing the following parameters:
      • {AppName}: push `AppName`
      • {PushDomain}: push domain name
      • {StreamID}: stream ID
      • {Year}: screenshot time (year)
      • {Month}: screenshot time (month)
      • {Day}: screenshot time (day)
      • {Hour}: screenshot time (hour)
      • {Minute}: screenshot time (minute)
      • {Second}: screenshot time (second)
      • {Width}: width of the screenshot
      • {Height}: height of the screenshot
      • {Ext}: extension (.jpg)
      Note: it can contain only letters, digits, placeholders, and symbols (-, !, _, ., *).
      Example: if the file name format is {Year}-{Month}-{Day}- {Hour}-{Ext}, the screenshot automatically captured during live streaming at 14:00:00, January 1, 2020 will be stored and named "2020010114.jpg" in COS.

    Binding a Template with Domain Names

    1. Log in to the CSS console and select Feature Configuration > **Live Screencapture & Porn Detection.
    2. Enter the domain name binding page in either of the following ways:
      • Directly bind a domain name: click Bind Domain Name in the upper left.
      • Bind a domain name after creating a screencapture and porn detection template: after successfully creating a screencapture and porn detection template, click Bind Domain Name in the pop-up.
    3. Select a screencapture and porn detection template and a push domain name in the domain name binding window and then click Confirm.
      Note:

      You can click Add to bind multiple push domain names with this template.

    Unbinding a Template from Domain Names

    1. Log in to the CSS console and select Feature Configuration > **Live Screencapture & Porn Detection.
    2. Select a screencapture and porn detection template with bound domain names, find the target domain name, and click Unbind.
    3. In the pop-up, click Confirm.

    Modifying a Template

    1. Log in to the CSS console and select Feature Configuration > **Live Screencapture & Porn Detection.
    2. Find the desired screencapture and porn detection template that you created, and click Edit on the right to modify template information.
    3. Click Save.

    Deleting a Template

    Note:

    If the template has been bound with domain names, you need to unbind them before deleting the template.

    1. Log in to the CSS console and select Feature Configuration > **Live Screencapture & Porn Detection.
    2. Find the desired screencapture and porn detection template that you have created, and click Delete at the top.
    3. In the pop-up, click Confirm.

    Operations

    For more information about binding and unbinding a domain name with or from a screencapture and porn detection template, see Screencapture and Porn Detection Configuration.