Files
ZLMediaKit/conf
YuLi 10268396b8 feat(hls): m3u8增加EXT-X-PROGRAM-DATE-TIME标签 (#4831)
按RFC 8216第4.3.2.6节,在每个切片的EXTINF之前写入该切片首帧对应的服务器
系统时间(UTC的ISO 8601格式,含毫秒),供播放器对齐字幕流、标记事件点。
直播m3u8与点播vod.m3u8均已支持。

默认关闭,由hls.programDateTime配置项开启。

时间统一以UTC输出而不采用本地时区偏移,因为ZLToolKit的getGMTOff()不含夏令
时修正、且在夏令时切换后不会刷新,会使标注的偏移与实际时刻相差1小时。

索引文件会被反复重建(点播模式下切片不删除,每次重建都遍历全部切片),故取值
在切片入列时格式化一次并缓存,避免在makeIndexFile()中对全部切片重复格式化。

close #4769
2026-09-22 11:54:01 +08:00
..
2024-03-16 22:56:32 +08:00
2026-03-15 15:10:51 +08:00
2023-12-09 16:23:51 +08:00

Key parameters that affect performance in the configuration file

1. Protocol enable flags (e.g., protocol.enable_hls, protocol.enable_rtsp)

Controls the protocol conversion flags. Disabling unnecessary protocols will save CPU and memory resources.

2. On-demand protocol flags (e.g., protocol.hls_demand, protocol.rtsp_demand)

Controls on-demand protocol generation. When both this and the specific protocol are enabled, it saves CPU and memory when there are no active viewers. However, the first viewer will lose the instant playback capability, impacting the initial experience.

3. protocol.paced_sender_ms

The interval for the smooth sending timer. This helps address playback stuttering caused by irregular data transmission from the source. When enabled, the timer uses data timestamps to pace the transmission, improving the viewing experience. However, this increases CPU and memory consumption. A shorter timer interval results in higher CPU usage but better smoothness. The recommended interval is between 30 and 100 milliseconds. For optimal results, use this feature in conjunction with setting protocol.modify_stamp to 2 (which suppresses timestamp jumps).

4. general.mergeWriteMS

Enables write coalescing, which reduces the number of system calls and the frequency of data sharing between threads during transmission. This significantly boosts forwarding performance but comes at the cost of increased playback latency and reduced transmission smoothness.

5. rtp_proxy.gop_cache

Enables the GOP (Group of Pictures) caching feature for the startSendRtp cascaded interface, designed to allow instant playback for cascading setups (e.g., GB28181). Note that this setting does not affect the instant playback capability of ZLMediaKit's external live streaming services. Enabling this option increases memory usage but has a minimal impact on the CPU. We recommend disabling it if you don't use the startSendRtp interface.

6. hls.fileBufSize

Tuning this parameter can improve the disk I/O performance when writing HLS streams.

7. record.fileBufSize

Tuning this parameter can improve the disk I/O performance when recording MP4 files.