Screencapturing Event Notification

Last updated: 2021-03-12 11:24:02

    The CSS screencapturing feature is used to take screenshots of a real-time live stream at regular intervals and generate images. You can get the information of screenshots from callback notifications. Such screenshot data can be used for porn detection, live room cover generation, and other scenarios.


    • You need to understand how to configure the callback feature and receive callback messages on Tencent Cloud CSS before reading this document. For more information, please see How to Receive Event Notification.
    • The screenshot information obtained after a screencapturing callback event is triggered can be used for porn detection, live room cover generation, and other scenarios.

    Screencapturing Event Parameter Description

    Event type parameters

    Event Type Field Value Description
    CSS screencapturing event_type = 200

    Common callback parameters

    Field NameTypeDescription
    t int64 Expiration time, which is the Unix timestamp when the event notification signature expires.
    • The default expiration time of a message notification from Tencent Cloud is 10 minutes. If the time specified by the `t` value in a message notification has elapsed, it can be determined that this notification is invalid, thereby preventing network replay attacks.
    • The format of `t` is a decimal Unix timestamp, i.e., the number of seconds that has elapsed since January 01, 1970 00:00 (UTC/GMT time).
    sign string Security signature of event notification (sign = MD5(key + t)).
    Note: Tencent Cloud splices the encryption `key` and `t`, calculates the `sign` value through MD5, and places it in the notification message. After your backend server receives the notification message, it can confirm whether the `sign` is correct based on the same algorithm and then determine whether the message is indeed from the Tencent Cloud backend.


    <span id="key"></span>key is the callback key in Feature Template > Callback Configuration, which is mainly used for authentication. In order to protect the security of your data, we recommend you enter it.

    Callback message parameters

    Field Name Type Description
    stream_id string CSS stream name
    channel_id string The value is the same as CSS stream name
    create_time int64 Unix timestamp when a screenshot is generated
    file_size int Screenshot file size in bytes
    width int Screenshot width in pixels
    height int Screenshot height in pixels
    pic_url string Screenshot file path, such as /path/name.jpg
    pic_full_url string Screenshot download URL

    Sample callback message