1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Change the hls_aof_ratio to 2.1. v5.0.200 (#3886)

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.

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
This commit is contained in:
Winlin 2023-11-19 21:50:11 +08:00 committed by winlin
parent 4e4cce867b
commit a1901b5213
5 changed files with 6 additions and 4 deletions

View file

@ -1768,8 +1768,8 @@ vhost hls.srs.com {
# for example, the hls_fragment is 10s, hls_aof_ratio is 1.2,
# the segment will reap to 12s for pure audio.
# Overwrite by env SRS_VHOST_HLS_HLS_AOF_RATIO for all vhosts.
# default: 1.2
hls_aof_ratio 1.2;
# default: 2.1
hls_aof_ratio 2.1;
# the hls window in seconds, the number of ts in m3u8.
# Overwrite by env SRS_VHOST_HLS_HLS_WINDOW for all vhosts.
# default: 60