Opened 3 years ago

Closed 11 months ago

#9321 closed defect (invalid)

Wrong HLS segment duration on playlist rotation

Reported by: ohmerci Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: hls segment duration
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:

Trying to output a HLS live stream with fixed segment duration (10s in this case).

video segmentation issue: when hls_list_size is reached, instead of a 10s video segment a 2s and 8s video segment are generated (durations of the parts is dependent on GOP length and hls_time value), and added to the video manifest.
After which output continues with 10s segments as expected.

Intitial full-lenght manifest:


Next, the manifest file rotates for a first time and a 8s segment is added


Next, 10s are generated and added to the manifest file again


audio segmentation issue: when hls_list_size is reached a 0s audio segment is generated and added to the audio manifest file.


Forcing 10s GOP -g:v 250 (and remove keyint=50:min-keyint=50:no-scenecut) , fixes the splitted video segment, but doesn't fix the 0s audio segment.

How to reproduce:

ffmpeg -re -fflags +genpts -i /data/str02/pseudo_src/devmul/ott-en-us.mp4 -map 0 -c:v libx264 -x264opts "keyint=50:min-keyint=50:no-scenecut" -b:v 2M -g:v 50 -r:v 25 -c:a aac -b:a 128k -f hls -hls_delete_threshold 20 -hls_segment_filename "hlsdir/%v_%d.ts" -hls_time 10 -hls_init_time 10 -hls_list_size 5 -master_pl_name master.m3u8 -var_stream_map "a:0,name:eng_audio,agroup:audio,language:ENG,default:YES v:0,name:video,agroup:audio" -hls_flags independent_segments+program_date_time+round_durations "hlsdir/%v.m3u8"

ffmpeg version:

ffmpeg version N-102852-g758e2da289 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --prefix=/data/local/home/ramdata/ffmpeg-master --enable-gpl --enable-version3 --enable-nonfree --enable-openssl --enable-postproc --enable-avfilter --enable-pthreads --enable-filter=movie --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libx264 --enable-libfdk-aac

Change History (1)

comment:1 by ohmerci, 11 months ago

Resolution: invalid
Status: newclosed

The changing segment duration during rotation is to be expected when using the hls_init_time parameter.

Note: See TracTickets for help on using tickets.