ossrs / srs

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
24.75k stars 5.28k forks source link

Change the hls_aof_ratio to 2.1. v5.0.200 v6.0.101 #3886

Closed winlinvip closed 7 months ago

winlinvip commented 7 months ago

In pure audio mode, there are no keyframes. Therefore, we can only rely on the length of the slice to determine whether it should be output. hls_aof_ratio is the coefficient that, once reached, will generate a new slice.

In scenarios with video, if the hls_aof_ratio is too small, for example 1.2, and the GOP (Group of Pictures) is 10 seconds, then a slice will definitely be generated at 12 seconds. At this point, if there are no keyframes, it will cause the next slice to start with a non-keyframe.

A safer coefficient is twice the GOP (Group of Pictures). This way, it won't trigger incorrectly and prevent the individual transcoding of a ts segment file.


TRANS_BY_GPT4


Co-authored-by: Haibo Chen 495810242@qq.com