HlsSink creates first segment of very large duration

I am using a pipeline that has an appsource, queue, h264parse, mpeg4tsmux and an hlsSink. Everytime the pipeline is created, the first element (#EXTINF) ends up with very large value more than 30 hours. I have set up the time interval to 2 seconds only. How is the duration measured in HlsSink, is it the pts value of previous buffer minus the pts value of current one? How is it measured at the start?

The hlssink/2/3 requires frequent keyframe to split. Perhaps it didn’t get any for 30h?