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.
You can go to Live Transcoding to configure transcoding templates with different bitrates and resolutions for different network conditions. For more information on transcoding, see Live Remuxing and Transcoding.
The three commonly used playback bitrates for original, HD, and SD streams are as follows:
You can use the time shifting feature to rewind and play a video stream from earlier time points. The feature currently only supports the HLS protocol. For more information on time shifting and how to activate it, see Time Shifting.
To make your playback domain support HTTPS, make sure you have a valid certificate and private key, go to Domain Management, find the target playback domain, click Manage, and select Advanced Configuration > HTTPS Configuration to add an HTTPS configuration. The configuration takes effect in about 2 hours.
CSS provides stable CDN nodes across the Chinese mainland and around the world. If your end users are located outside the Chinese mainland, you can select Global or Outside Chinese mainland for Acceleration region when adding domains in Domain Management.
To prevent potential losses caused by unauthorized users using your URLs for playback and stealing your Tencent Cloud traffic, we strongly recommend you enable hotlink protection for your playback URLs. Hotlink protection is determined by four parameters:
key (hash key),
txSecret, and the validity period.
|Hotlink Protection Parameter||Description||Remarks|
|txTime||The expiration time of the playback URL.||It must be a Unix hexadecimal timestamp.
Playback is allowed only if
|key||The MD5 key.||This parameter is customizable. You can set a primary and a backup key.
If your primary key is disclosed, you can use the backup key to splice playback URLs while changing the primary key.
|txSecret||The encryption parameter in the playback URL.||The value of this parameter is calculated based on
|Validity period||The authentication validity period.||It must be greater than 0.
If you set
Three parameters are needed to generate a hotlink protection URL:
key (a random string),
StreamName (the stream name), and
txTime (in hexadecimal format).
Assume that you set
key to somestring,
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 of the original stream is:
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 of the HD stream is:
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 configuration to take effect.
- HTTP-FLV: Ongoing playback can continue even after
txTime, but new playback requests will be rejected.
- HLS: With HLS, a stream is broken into short chunks, and TS segments are requested as playback continues. Therefore, if you set
txTimeto 10 minutes after the current time, playback will be rejected after 10 minutes. To avoid this, you can update the HLS request URL dynamically on the server or set a longer validity period.
The primary key can contain only letters and digits, with up to 256 characters. For details, please see Playback Authentication Configuration.
We recommend that you set its validity period to the duration of a live streaming session.
If you set the validity period too long, others may use your URL for push without your authorization.
There is no limit on the validity period of a push address. You can have your server automatically splice push URLs to generate URLs with longer validity periods. For detailed directions, see Splicing Live Streaming URLs.
We do not recommend you set a very long validity period. It may cause errors and authentication failures.
Normally, the latency of playing an FLV stream that is pushed over RTMP is around 2-3 seconds. If your playback latency is exceptionally high, please refer to Troubleshooting High Latency to troubleshoot the issue.
No. You can set it only before pushing a stream. The bitrate depends on your upload speed. Setting it too high may cause dropped frames and stuttering.
Live push and playback are bound with stream IDs, so you do not need to delete rooms. If you are using the IM service and want to delete IM rooms to avoid reaching the maximum number of rooms, see Disbanding a Group.
If you are using channel mode, you can call the
DeleteLVBChannel API to delete channels (you need to pass in the IDs of the channels you want to delete).
Channel mode is a legacy mode which is no longer updated or maintained.
You can use the API to disable a live stream when pornographic or other inappropriate content is detected. For details, see ForbidLiveStream.
Background playback allows the audio of a live stream to continue even when your app runs in the background. This feature depends on the playback device and should be implemented based on your actual business logic.
CSS uses Nginx for encryption, so make sure your certificate type is Nginx.
An authentication-enabled playback URL will become invalid after authentication is disabled, even if the validity period has not elapsed.
CSS sets an upper limit on the total number of requests sent by all
SecretId under an account. After the limit is reached, new requests will not be responded to.
For example, an upper limit of 200 requests per second indicates that the Tencent Cloud server can receive up to 200 requests sent by all
SecretId under your account within one second. It doesn’t matter whether the requests are sent by one or more users, or whether they query one or multiple streams.
You may have set the frame rate too high. A frame rate higher than 15 fps is enough to ensure smooth playback. Try reducing the frame rate.
A stream may have no data for a long time when there is a push problem, for example, if the app crashes or the phone is turned off.
In such cases, if the backend doesn’t receive any data for 70 seconds, it will disconnect the stream.
API keys are used for the authentication of legacy APIs. We have updated our APIs to v3.0. To use the new APIs, go to Manage API Key to get the
H.265 is supported by fewer browsers than H.264, and playback may fail if your browser does not support H.265. You can configure a transcoding template to transcode the video to H.264.
M3U8 files are named automatically based on stream names. Stream names do not support Chinese characters.
You can get the number of online viewers by calling the DescribeStreamPlayInfoList API, but the result may not be 100% accurate. For example, if three users use the same IP address for playback at the same time, they will be counted as one viewer. Note that the data returned by this API is relevant only if your playback protocol is RTMP or FLV, not if it is HLS.
Backup streams are enabled by default with CSS. If you push two streams using the same stream name at the same time, during playback, only the first stream will be visible. If this stream is interrupted, the second stream will become visible.
No, you can’t. You can bind only one watermark template to each push domain.
You cannot view users’ playback durations currently.
Yes. Playback is based on playback URLs and is possible even if you don’t transcode the streams (as long as the URL is valid).
The time to the first frame depends mainly on the number of viewers. The more viewers, the higher the cache hit ratio and the shorter the time to the first frame.
You can configure a custom IP allowlist or blocklist to control access to your live streams based on IP addresses. For detailed directions, see Configuring IP Allowlist/Blocklist.
CSS identifies pornographic content based on screenshots. The number of screenshots taken for porn detection depends on the screenshot interval, which you can set in Live Screencapture & Porn Detection of the CSS console.
The default screenshot interval during push is two seconds. Value range: 2-300 (seconds).
You can use the DescribeBillBandwidthAndFluxList API to query the data.
CSS supports pushing audio-only streams (streaming software is required). You can also create audio-only transcoding templates.
You can call an RESTful API to query the data. For details, see DescribeStreamPlayInfoList.
CSS does not offer an API to query the duration of an active stream. You can calculate the duration based on the callbacks for push and stream interruption.
You can query the viewers of a live stream using either of two methods:
Go to the CSS console, select Data Center > Stream Data Query on the left sidebar, and click Playback Data to view the number of concurrent connections.
The number of concurrent connections equals the number of online viewers only if the playback protocol is RTMP or FLV.
Call the DescribeStreamPlayInfoList API to get the number of online viewers.
You need to configure the callback for stream interruption first. If a stream is interrupted by a network disconnection, the system will try to resume the stream automatically. If the stream is resumed within 70 seconds, you will not receive the callback for stream interruption. If the system fails to resume the stream within 70 seconds, it will disconnect the stream, and you will receive the stream interruption callback.
No. You can use RTMP for push and RTMP, FLV, HLS, or UDP for playback.
Check the following:
If the above does not solve your problem, please contact Tencent Cloud technical support.
Check the following:
LEB is a playback solution, while hosts are at the push end. To change the resolution of hosts, you need to create a transcoding template and bind it to your domain before playback.