Anda dapat memanggil SetLiveStreamDelayConfig untuk mengonfigurasi latensi live streaming.
Deskripsi operasi
-
This operation configures the latency for a streaming domain.
-
The server-side cache stores an integer number of Groups of Pictures (GOPs). Therefore, the latency cannot be less than the GOP size. The actual latency is estimated based on the GOP size. For example, if you set RtmpDelay to 4 seconds for an RTMP stream and the GOP size is 2 seconds, the actual latency ranges from 2 seconds (4 - 2) to 6 seconds (4 + 2). If the GOP size is larger than the configured RtmpDelay, for example, GOP = 5 seconds and RtmpDelay = 4 seconds, the latency fluctuates between 0 and 9 seconds.
-
Latency configurations do not take effect for audio-only streams. The default latency is close to 0 seconds.
-
For an HLS configuration, the segment size is calculated as `Delay / 3` and rounded down to the nearest integer. The minimum segment size is 1 second. The maximum number of segments is 4 if the segment size is 3 seconds or more. Otherwise, the maximum is 6 segments.
-
The actual HLS segment size cannot be smaller than the GOP size.
-
The HLS latency is calculated as: Configured Segment Size × 3.
-
If you do not call this operation, the system uses the default values. The default latency is 2 seconds for RTMP and 4 seconds for FLV. For HLS, the default segment size is 5 seconds, which results in a latency of 15 seconds with a maximum of 6 segments.
Queries per second (QPS) limit
The QPS limit for this operation is 1,000 calls per second per user. If you exceed this limit, API calls are throttled, which may affect your business. Plan your calls accordingly.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
live:SetLiveStreamDelayConfig |
update |
*Domain
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
ID wilayah. |
cn-shanghai |
| DomainName |
string |
Yes |
Domain streaming. |
example.com |
| HlsDelay |
integer |
No |
Latensi pemutaran HLS. Unit: detik. Catatan
Jika parameter ini dikosongkan, latensi diatur berdasarkan nilai HlsLevel. |
4 |
| HlsLevel |
string |
No |
Tingkat latensi HLS. Parameter ini diabaikan jika HlsDelay diatur. Nilai valid:
Catatan
Jika HlsDelay dan HlsLevel keduanya dikosongkan, nilai default short digunakan. |
short |
| FlvDelay |
integer |
No |
Latensi pemutaran FLV. Unit: detik. Catatan
Jika parameter ini dikosongkan, latensi diatur berdasarkan nilai FlvLevel. |
8 |
| FlvLevel |
string |
No |
Tingkat latensi FLV. Parameter ini diabaikan jika FlvDelay diatur. Nilai valid:
Catatan
Jika FlvDelay dan FlvLevel keduanya dikosongkan, nilai default short digunakan. |
medium |
| RtmpDelay |
integer |
No |
Latensi pemutaran RTMP. Unit: detik. Catatan
Jika parameter ini dikosongkan, latensi diatur berdasarkan nilai RtmpLevel. |
4 |
| RtmpLevel |
string |
No |
Tingkat latensi RTMP. Parameter ini diabaikan jika RtmpDelay diatur. Nilai valid:
Catatan
Jika RtmpDelay dan RtmpLevel keduanya dikosongkan, nilai default short digunakan. |
short |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
4C747C97-7ECD-4C61-8A92-67AD806331FF |
Contoh
Respons sukses
JSONformat
{
"RequestId": "4C747C97-7ECD-4C61-8A92-67AD806331FF"
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.