Opened 2 years ago

Last modified 14 months ago

#9510 open defect

HLS with fMP4 produces invalid segments

Reported by: Andreas Unterweger Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: hls
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description (last modified by Andreas Unterweger)

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 CDR-Dinner_LAN_800k.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://samples.ffmpeg.org/MPEG-4/CDR-Dinner_LAN_800k.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.

Change History (6)

comment:1 by Andreas Unterweger, 2 years ago

Description: modified (diff)

comment:2 by Andreas Unterweger, 2 years ago

Description: modified (diff)

comment:3 by Balling, 14 months ago

Resolution: needs_more_info
Status: newclosed

File is gone.

comment:4 by Andreas Unterweger, 14 months ago

Description: modified (diff)
Resolution: needs_more_info
Status: closedreopened

The issue is still present, even with recent master. I pointed the URL to a different file from the FFmpeg samples. It occurs not only with this file, but every file I tried as an input. As stated above, this seems to be an issue of the HLS segmenter.

comment:5 by Balling, 14 months ago

Status: reopenedopen

Okay, yes, I can reproduce that.

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

Actually it is -hls_time 0.6 that resolves the issue.

Last edited 14 months ago by Balling (previous) (diff)

comment:6 by Balling, 14 months ago

Keywords: HLS CHUNK ffmpeg removed
Reproduced by developer: set
Note: See TracTickets for help on using tickets.