[FFmpeg-trac] #9510(avformat:new): HLS with fMP4 produces invalid segments

FFmpeg trac at avcodec.org
Mon Nov 15 09:47:42 EET 2021


#9510: HLS with fMP4 produces invalid segments
-------------------------------------+-------------------------------------
             Reporter:  Andreas      |                    Owner:  (none)
  Unterweger                         |
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:  avformat
              Version:  git-master   |               Resolution:
             Keywords:  HLS hls      |               Blocked By:
  CHUNK ffmpeg                       |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Description changed by Andreas Unterweger:

Old description:

> Using fMP4 segments with strftime and hls_init_time produces segments
> which are too short and cannot be played back.
>
> Example call:
>
> {{{
> ./ffmpeg -y -i timer_1M.mp4 -acodec aac -b:a 64k -vcodec h264 -b:v 1M -f
> hls -hls_segment_type fmp4 -strftime 1 -hls_segment_filename '%%18d.m4s'
> -hls_flags second_level_segment_index+split_by_time -hls_time 0.6
> -hls_init_time 0.600001 index.m3u8
> }}}
>
> This produces a segment 000000000000000006.m4s which is only about a
> tenth of the size of the other segments. Running FFprobe on it (by
> creating a dummy playlist with only this segment), it seems to contain
> only audio, but no video frames.
>
> Removing the hls_init_time parameter from the command "resolves" the
> issue, i.e., the segments are then split correctly and have video frames.

New description:

 Using fMP4 segments with strftime and hls_init_time produces segments
 which are too short and cannot be played back.

 Example call:

 {{{
 ./ffmpeg -y -i timer_1M.mp4 -acodec aac -b:a 64k -vcodec h264 -b:v 1M -f
 hls -hls_segment_type fmp4 -strftime 1 -hls_segment_filename '%%18d.m4s'
 -hls_flags second_level_segment_index+split_by_time -hls_time 0.6
 -hls_init_time 0.600001 index.m3u8
 }}}

 This produces a segment 000000000000000006.m4s which is only about a tenth
 of the size of the other segments. Running FFprobe on it (by creating a
 dummy playlist with only this segment), it seems to contain only audio,
 but no video frames.

 Removing the hls_init_time parameter from the command "resolves" the
 issue, i.e., the segments are then split correctly and have video frames.

 I tried this with different files, including [https://file-examples-
 com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4]. Changing
 the GOP size with -g:v does not make the error go away, which is why I
 think it is a bug in the HLS segmenter.

--
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9510#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list