[FFmpeg-trac] #5307(ffmpeg:new): HLS start_time and duration incorrect
FFmpeg
trac at avcodec.org
Tue Jun 28 03:16:57 CEST 2016
#5307: HLS start_time and duration incorrect
----------------------------------+----------------------------------
Reporter: ronag | Owner:
Type: defect | Status: new
Priority: normal | Component: ffmpeg
Version: 3.0.2 | Resolution:
Keywords: hlsenc.c | Blocked By:
Blocking: | Reproduced by developer: 1
Analyzed by developer: 1 |
----------------------------------+----------------------------------
Changes (by an_ffmpeg_user):
* reproduced: 0 => 1
* cc: cgordon@… (added)
* component: undetermined => ffmpeg
* keywords: => hlsenc.c
* version: unspecified => 3.0.2
* analyzed: 0 => 1
Comment:
This looks like a duplicate of https://trac.ffmpeg.org/ticket/5009.
If I download your original files from dropbox...
{{{
$ cat ./jellyfish.m3u8
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:9
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:8.341667,
jellyfish0.ts
#EXTINF:6.639967,
jellyfish1.ts
#EXTINF:8.341667,
jellyfish2.ts
#EXTINF:6.673333,
jellyfish3.ts
#EXT-X-ENDLIST
}}}
and compare to the FFprobe of the individual segments
{{{
$ ffprobe -loglevel quiet -print_format flat -show_entries format=duration
"./jellyfish0.ts"
format.duration="8.341667"
$ ffprobe -loglevel quiet -print_format flat -show_entries format=duration
"./jellyfish1.ts"
format.duration="6.639967"
$ ffprobe -loglevel quiet -print_format flat -show_entries format=duration
"./jellyfish2.ts"
format.duration="8.341667"
$ ffprobe -loglevel quiet -print_format flat -show_entries format=duration
"./jellyfish3.ts"
format.duration="6.706700"
}}}
You can see that it is the last EXTINF segment duration that is being
calculated incorrectly and written to the m3u8. The issue is within
hlsenc.c
The effect of this is:
1) FFprobe subsequently gets the duration incorrect because it sums the
durations of the EXTINF
2) Some Smart TVs actually stop playback of the asset early.
The HLS Start Time issue should not be an issue. A non-zero start time
for TS files is valid and in-spec. There are existing command line
options to preserve original timestamps.
But the duration of the last frame within the M3U8 is certainly a bug.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/5307#comment:5>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list