Negative segment durations in m3u8 file

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Negative segment durations in m3u8 file

Valentin Schweitzer

when using the HLS muxer, some segment durations in the
output m3u8 file are negative when specifying a very
short hls_time.

Using the attached 264 file and FFmpeg head,
this behavior can be recreated like this:

./ffmpeg -report -i test.264 -pix_fmt yuv420p -vcodec libx264 -b:v 10000k -hls_segment_type fmp4 -hls_time 0.1 -hls_flags split_by_time+second_level_segment_index -strftime 1 -hls_segment_filename stream-%%18d.m4s -hls_playlist_type event index.m3u8

The command line output can be found in the attached log file.
This command produces output along the lines of


An uncut example m3u8 file is attached.
The varying output lengths are expected, due to
splitting along I-Frames, although negative
durations seems like an error.

As I am not sure if this is a case of user
error, I'd like to ask for any advice
to fix this issue and, if possible, find
out why it occurs before opening a trac

The command above is a shortened version
of the original command with which this
bug was discovered. A change of framerate
using -r 30 changes the output values,
but still leaves some negative timestamps.

This behaviour was tested on Ubuntu with
FFmpeg HEAD and on Windows with the latest
Zeranoe pre-built.

I would be thankful for any advice.

ffmpeg-user mailing list
[hidden email]

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

test.264 (814K) Download Attachment
ffmpeg-20200811-152051.log (170K) Download Attachment
index.m3u8 (7K) Download Attachment