Publish/Playback

Last updated: 2021-03-03 12:06:15

    Is there an upper limit on the number of concurrent viewers?

    CSS does not limit the number of concurrent viewers. A live stream can be viewed by as many users as the network allows. However, if you have set a bandwidth limit, new viewers will be unable to watch a live stream once the limit is reached.

    How do I use transcoding for playback?

    You may want to use different bitrates and resolutions under different network conditions. You can create transcoding templates with different bitrates and resolutions in the console. For more information about transcoding, see Best Practice > CSS Encapsulating and Transcoding.

    Original definition, HD, and SD

    The three commonly used playback bitrates for original-definition, HD, and SD streams are as follows:

    • For an original-definition stream, the playback bitrate is the same as the publishing bitrate.
    • For an HD (1080p) stream, the recommended playback bitrate is 2,000 Kbps.
    • For an SD (720p) stream, the recommended bitrate is 1,000 Kbps.

    How can I use time shifting for replay?

    You can use the time shifting feature to replay highlights. The feature supports only the HLS protocol for the time being. For more information on time shifting and how to activate it, see Best Practices > CSS Time Shifting.

    How can I use HTTPS for playback?

    If you want your playback domain name to support HTTPS, make sure you have a valid certificate and private key, and go to Domain Management, find your playback domain name, click Manage, select Advanced Configuration, and add configurations in HTTPS Configuration. It may take a while (2 hours) for the configurations to take effect, after which your streams can be played back over the HTTPS protocol.

    How can I use an acceleration node outside the Chinese mainland for playback?

    CSS has CDN nodes across the Chinese mainland and around the world, with extensive coverage and high stability. If your end users are outside the Chinese mainland, you can select Global Acceleration or Hong Kong/Macao/Taiwan (China Region) and other regions for acceleration region when configuring your domain name in Domain Management.

    Note:

    Global acceleration supports only the HTTP-FLV and HLS protocols for the time being.

    To prevent unauthorized users from accessing your playback URLs, which would consume your Tencent Cloud traffic, you are strongly advised to enable hotlink protection for your playback URLs to avoid potential losses caused by hotlinking. With CSS, hotlink protection for playback URLs is controlled by four parameters: txTime, key (hash key), txSecret, and the validity period.

    Hotlink Protection Parameter Description Remarks
    txTime Effective time of playback URL It is a Unix hexadecimal time.
    If the value of txTime is greater than the time of a request, the stream can be played back successfully; otherwise the request will be rejected.
    key MD5 key You can customize a key as well as set a master and slave key.
    If your master key is leaked, you can use the slave key to splice playback URLs and change the value of the master key.
    txSecret Encryption parameter in playback URL The value of this parameter is calculated based on key, StreamName, and txTime using the MD5 algorithm.
    txSecret = MD5 (key+StreamName+txTime)
    Validity period Validity period of playback URL It must be greater than 0.
    If txTime is set to the current time and the validity period is 300 seconds, then the playback URL expiration time is the current time + 300 seconds.

    The calculation of a hotlink protection URL requires three parameters: key (a random string), StreamName (stream name), and txTime (in the hexadecimal format).
    Suppose you set key to somestring, the stream name (StreamName) to test, txTime to 5c2acacc (2019-01-01 10:05:00), the HD bitrate to 900 Kbps, and the name of the transcoding template to 900.
    The playback URL for an original-definition stream would be:

    txSecret = MD5(somestringtest5c2acacc) = b77e812107e1d8b8f247885a46e1bd34
    http://domain/live/test.flv?txTime=5c2acacc&txSecret=b77e812107e1d8b8f247885a46e1bd34
    http://domain/live/test.m3u8?txTime=5c2acacc&txSecret=b77e812107e1d8b8f247885a46e1bd34

    The playback URL for an HD stream would be:

    txSecret = MD5(somestringtest_9005c2acacc) = 4beae959b16c77da6a65c7edda1dfefe
    http://domain/live/test_900.flv?txTime=5c2acacc&txSecret=4beae959b16c77da6a65c7edda1dfefe
    http://domain/live/test_900.m3u8?txTime=5c2acacc&txSecret=4beae959b16c77da6a65c7edda1dfefe

    1. Log in to the CSS console and click Domain Management.
    2. Find and click your playback domain name or click Manage to enter the details page.
    3. Select Access Control and click Edit.
    4. Enable Playback Authentication and click Save.

    Note:

    • It takes 30 minutes for the configuration to take effect.
    • HTTP-FLV: ongoing playback can continue even after the URL expires, but new requests for playback via the URL will be rejected.
    • HLS: as HLS breaks a stream into short chunks, it keeps requesting M3U8 files to get the latest TS segments. Suppose you set txTime to the current time and the validity period to 10 minutes, then an HLS playback URL request sent 10 minutes after the current time will be rejected. To avoid this, you can update the HLS request URL dynamically on the server or set longer validity periods.

    What format requirements must a master key for playback authentication meet? Is there any limit on its validity period?

    A master key for playback authentication can be a random combination of uppercase and lowercase letters and digits and must not be longer than 256 bits.
    We recommend that you set the validity period to the duration of a live stream.

    I recorded live streams. How can I get the recording files?

    Recording files are automatically saved in the VOD system after generation and can be found via: