Push Configuration

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

    To protect the information security of live streaming, push authentication is enabled for CSS push domain names by default. You can use the push address generator on the push address details page to generate a push URL. Then, you can use the URL to push the stream (upload the live streaming video) to the CSS platform.

    Notes

    • CSS provides a test domain name xxxx.livepush.myqcloud.com. You can use it for push testing, but we do not recommend using it as the push domain name for your real business.
    • CSS can only generate push URLs in RTMP format.
    • The generated push URL is valid before the set expiration time. You can generate a new URL after the old one expires.

    Prerequisites

    You have signed up for a Tencent Cloud account and completed identity verification. Unverified users cannot purchase CSS instances in the Chinese mainland.

    Authentication Configuration

    1. Go to Domain Management, click the target push domain name or click Manage to enter the domain details page.
    2. Click Push Configuration, view the Authentication Configuration section, and click Edit on the right.
    3. On the Authentication Configuration page, toggle to enable or disable push configuration.
    4. Enter the primary key and backup key, and click Save.
      Note:

      Primary key is required and backup key is optional. Entering both allows you to switch keys when one key is disclosed.

    Push Address Generator

    Directions

    1. Go to Domain Management, click the target domain name or click Manage on its right to enter its details page.
    2. Select Push Configuration > Push Address Generator and configure as follows:
      1. Select an expiration time, such as 2019-10-31 23:59:59.
      2. Enter a custom StreamName, such as liveteststream.
      3. Click Generate Push Address to generate an RTMP push URL containing the StreamName.
    3. You can test, disable, or delete a stream in Stream Management after live push.
    4. After the push URL is generated, you can use it to initiate live push. To view live streaming, you should use a playback URL. For more information, please see Playback Configuration.

    Notes on Push URL

    RTMP push URL format:

    rtmp://domain/AppName/StreamName?txSecret=Md5(key+StreamName+hex(time))&txTime=hex(time)
    

    Where:

    • domain: push domain name
    • AppName: live streaming application name, which is live by default and customizable
    • StreamName: custom stream name used to identify a live stream
    • txSecret: authentication string generated after push authentication is enabled
    • txTime: expiration timestamp set for a push URL configured in the console
    • If you have enabled authentication for the domain name, the actual URL expiration time will be txTime plus the key validity period.

    Sample Code of Push URL

    Sample code for generating a push URL in PHP and Java is provided for your reference, which can be viewed by performing the following steps:

    1. Log in to the CSS console and click Domain Management.
    2. Select a push domain name or click Manage on the right to enter its details page.
    3. Select Push Configuration and scroll down to find Push Address Sample Code.
    4. Click the tab to view the PHP/Java sample code accordingly.
    <dx-code-holder data-codeindex="1"></dx-code-holder>