[FFmpeg-trac] #6533(avformat:reopened): Invalid EXT-X-TARGETDURATION in HLS

FFmpeg trac at avcodec.org
Thu Aug 10 10:28:57 EEST 2017

             Reporter:  tonn81       |                    Owner:
                 Type:  defect       |                   Status:  reopened
             Priority:  normal       |                Component:  avformat
              Version:  unspecified  |               Resolution:
             Keywords:  hls          |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
Changes (by tonn81):

 * status:  closed => reopened
 * resolution:  wontfix =>


 I would disagree with @stevenliu -- result generated by ffmpeg is not what
 is expected -- `TARGETDURATION` does not match the value given as

 Actually, there are two bugs in ffmpeg. Together they give this false

 Here are the bugs:

 1. **ffmpeg generate HLS chunks with duration that does not match given

    ffmpeg should generate chunks not longer than given with `--hls_time`.
 For `--hls_time 4` it generated `4.02` chunk instead of `4.0` or less.

 2. **ffmpeg converts chunk duration into `EXT-X-TARGETDURATION`

    According to official HLS validator (`mediastreamvalidator`), there
 could be 25% difference between actual chunk size and value. That means we
 should not ceil the value but rather round to nearest integer (so that
 delta between maximum chunk duration and `TARGETDURATION` is minimal).
 Then `4.02` would become `4`, not `5`.

 I could file another bug report for HLS chunks generation if needed.

Ticket URL: <https://trac.ffmpeg.org/ticket/6533#comment:4>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list