[FFmpeg-trac] #2828(avformat:new): HLS segment MPEGTS continuity counter is being incorrectly set to 0 on each segment
FFmpeg
trac at avcodec.org
Wed Jul 31 19:15:46 CEST 2013
#2828: HLS segment MPEGTS continuity counter is being incorrectly set to 0 on each
segment
-------------------------------------+-------------------------------------
Reporter: dlevinson5 | Type: defect
Status: new | Priority: critical
Component: avformat | Version:
Keywords: HLS MPEGTS | unspecified
Blocking: | Blocked By:
Analyzed by developer: 1 | Reproduced by developer: 1
-------------------------------------+-------------------------------------
Summary of the bug:
when creating hls segments using ffmpeg the continuity counter is being
reset to 0 for each segment instead of continuing from the prior segment.
This is somewhat critical since this breaks the MPEG2 specification and
does not pass Apple's HLS compliance requirements.
In the mpegts_write_header() function the pat, sdt and st_ts->cc counters
are reset when the segment is written instead of being carried forward
from the prior segment.
To work around this issue I created several static variables to persist
the continuity counters and added a flag to switch between preserving
continuity or using the default logic.
static int mpegts_pat = 15;
static int mpegts_sdt = 15;
static int mpegts_cc[10] = {15,15,15,15,15,15,15};
How to reproduce:
{{{
%ffmpeg -i <source> -c copy -map 0 -vbsf h264_mp4toannexb -initial_offset
10 -segment_list_type m3u8 -flags +global_header -f segment
-segment_list_flags +live -segment_list_type m3u8 -segment_list
\"{1}.m3u8\" -segment_time 10 -segment_format mpegts <output>_%d.ts
Inspect each segment continuity counter values in sequence and it will be
observed that the continuity counter is reset to 0 at the start of each
segment.
ffmpeg version v2.0 / N-54901-g55db06a / Win32/64
}}}
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2828>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list