title: FFmpeg HLS streaming - Why the program date time of older segment changing when re-streaming after discontinuity
body: <p>Following is the ffmpeg command to stream the data.</p>
  <pre><code>ffmpeg -re -f avfoundation 
  -framerate 30 -i 0 
  -codec:v h264_videotoolbox -x264-params keyint=120:scenecut=0 
  -codec:a copy -f hls 
  -hls_list_size 60 
  -hls_time 10 
  -hls_flags delete_segments 
  -hls_flags +append_list 
  -hls_flags +discont_start 
  -hls_flags +program_date_time 
  -strftime 1 
  -strftime_mkdir 1 
  -hls_segment_filename 
  '%Y%m%dT%H%M%S%z.ts' playlist.m3u8
  </code></pre>
  <p><strong>Following is the playlist.m3u8 content which generated for few seconds.</strong></p>
  <pre><code>#EXTM3U
  #EXT-X-VERSION:3
  #EXT-X-TARGETDURATION:10
  #EXT-X-MEDIA-SEQUENCE:0
  #EXT-X-DISCONTINUITY
  #EXT-X-DISCONTINUITY
  #EXTINF:10.000000,
  #EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:07:53.000+0530
  20201109T220753+0530.ts
  #EXTINF:10.000000,
  #EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:08:03.000+0530
  20201109T220803+0530.ts
  #EXT-X-ENDLIST
  </code></pre>
  <p>When the re-stream happens(in case of restarting the streaming service), the program date time of older segments(before #EXT-X-DISCONTINUITY) also get changed like below, which is unexpected.</p>
  <pre><code>#EXTM3U
  #EXT-X-VERSION:3
  #EXT-X-TARGETDURATION:10
  #EXT-X-MEDIA-SEQUENCE:0
  #EXT-X-DISCONTINUITY
  #EXT-X-DISCONTINUITY
  #EXTINF:10.000000,
  #EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:12:50.633+0530
  20201109T220753+0530.ts
  #EXTINF:10.000000,
  #EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:13:00.633+0530
  20201109T220803+0530.ts
  #EXT-X-DISCONTINUITY
  #EXTINF:10.000000,
  #EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:13:12.000+0530
  20201109T221312+0530.ts
  #EXTINF:5.400000,
  #EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:13:22.000+0530
  20201109T221322+0530.ts
  #EXT-X-ENDLIST
  </code></pre>
  <p>Why the program date time of older segment should change? Should we add any arguments in ffmpeg command to handle this?</p>