By default, CSS does not limit the number of online viewers for a live stream as long as the network and other conditions permit. However, if you have configured a bandwidth limit, new viewers cannot watch the live stream if there are so many existing viewers that the bandwidth limit is exceeded. In this case, the number of online viewers is limited.
In consideration of different network factors and to meet your needs for different resolutions at different bitrates, you can set transcoding templates with different bitrates and resolutions in Transcoding Configuration. For more information on transcoding, see Best Practice > CSS Encapsulating and Transcoding.
In a real playback scenario, three bitrates are generally used: original, HD, and SD.
If you want to replay highlights, you can use the time shifting feature which only supports the HLS protocol.
If your playback domain name needs to support HTTPS, you should prepare a valid certificate and a valid private key, go to Domain Management, find the desired playback domain name, click Manage, and select Advanced Configuration > HTTPS Configuration to add a configuration. After the configuration is successfully added, it will take effect in 2 hours, and then, your stream can be played back with the HTTPS protocol.
CSS has CDN nodes across Mainland China and around the world with wide coverage and high stability. If your end users are located outside Mainland China, you can select Global Acceleration or Hong Kong/Macao/Taiwan (China Region) and other regions as the acceleration region when configuring a domain name in Domain Management to enjoy coverage by global nodes.
The global acceleration of CSS supports only HTTP-FLV and HLS protocols.
In order to prevent illegal users from stealing your playback URL for use elsewhere that may cause traffic losses, we strongly recommend enabling hotlink protection for your playback address to avoid potential losses caused by hotlinking. A hotlink protection-enabled playback URL in CSS is mainly controlled by four parameters:
key (hash key),
txSecret, and validity period.
|Hotlink Protection Parameter||Description||Remarks|
|txTime||The effective time of the playback URL||It is in hexadecimal UNIX time.
If the current value of
|key||The key for the MD5 calculation||It can be customized.
You can set a master key and a slave key, so that if your master is accidentally leaked, you can use the slave key to splice the playback URL and change the value of the master key.
|txSecret||Encryption parameter in playback URL||The value of this parameter is obtained by performing MD5 encryption on the string spliced by
|Validity period||The validity period of the push address||The validity period must be set to greater than 0.
The calculation of a hotlink protection URL requires three parameters:
key (a random string),
StreamName (stream name), and
txTime (in hexadecimal format).
Suppose that the
key you set is somestring, the stream name (
StreamName) is test, the
txTime is 5c2acacc (2019-01-01 10:05:00), the HD bitrate is 900 Kbps, and the transcoding template name is 900.
Original stream playback address:
txSecret = MD5(somestringtest5c2acacc) = b77e812107e1d8b8f247885a46e1bd34 http://domain/live/test.flv?txTime=5c2acacc&txSecret=b77e812107e1d8b8f247885a46e1bd34 http://domain/live/test.m3u8?txTime=5c2acacc&txSecret=b77e812107e1d8b8f247885a46e1bd34
HD stream playback address:
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
- It takes 30 minutes for the playback authentication configuration to take effect.
- HTTP-FLV: the URL of the current playback will be able to continue playing back the stream after
txTimeexpires but will be rejected when it requests a playback again.
- HLS: as HLS uses a short link, it will continuously request .m3u8 files to get the latest ts segment. Assuming that you set the value of
txTimeto the current time + 10 minutes, the HLS playback URL request will be rejected after 10 minutes. To solve this problem, you can dynamically update the HLS request address on the server or set the expiration time of the HLS playback address to be longer.
The master key in the authentication configuration can contain 256 bits of uppercase and lowercase letters and digits. A random mix of letters and digits is enough.
We recommend that you set its validity period to the duration of the live stream.
The main purpose of setting a validity period for the push address is to authenticate and protect the push address to prevent unauthorized push and business losses.
There is no limit on the validity period of a push address, which can be set according to your business needs. You can also splice addresses to generate a push address with a longer validity period. For more information about splicing rules, please see How to Splice a Push URL.
We do not recommend a very long validity period of the push address, which may cause CSS to report an error during the use and report a failed authentication.
CSS pushes a stream using the RTMP protocol and plays it using the FLV protocol. Generally, the delay is about 2 to 3 seconds. A long delay often indicates an error.
No. The maximum CSS bitrate is automatically set by the push end, according to the upload speed of your network. The upper limit of bitrate (or maximum bitrate) depends on the upload speed of your network. If the maximum bitrate is too high, it will cause dropped frames and lag during a live stream.
CSS push and playback are currently associated with stream IDs, so you do not have to delete rooms. If you are using the IM service and want to delete IM rooms to avoid hitting its upper limit, please see Disbanding Groups.
If you are using the channel mode, you can call the
DeleteLVBChannel API and input CSS channel IDs as parameters to delete the CSS channels (in batches).
CSS has no longer provided updates or support for the channel mode.
This API is used to forbid a stream during porn detection. For example, if a host is found to play pornographic or terroristic content, this stream can be interrupted or forbidden at any time.
The background video playback feature should be provided by devices. You can develop this feature according to the actual business logic. As long as the live stream is not interrupted, in theory, you can play audio in the background.
CSS encryption uses Nginx, so the certificate type must be Nginx. Make sure your current certificate type is correct.
You can set a validity period for playback authentication. If the access authentication is disabled even within the validity period, the original playback address will be unavailable.
CSS puts an upper limit of the total number of requests sent by all SecretIds under an account. Requests exceeding the upper limit will not be responded.
For example, an upper limit of 200 requests per second indicates that Tencent Cloud server can receive up to 200 requests sent by all SecretIds under your account per second. The 200 requests can be sent by one or more customers, and can be used to query one or more streams.
The current push address may be incorrect. We recommend that you use a demo for mini program to test whether the push address can push streams properly.
It may be because the current frame rate is too high. The frame rate more than 15 fps is enough to ensure smooth video playback. We recommend lowering the frame rate.
It occurs when the device has a problem pushing the stream.
For example, exceptions can be caused by application crash, mobile phone shutdown and other non-subjective factors. In this case, the system may disconnect actively if it cannot collect the data of pushed streams in the backend within 70 seconds.