HLS Playback Issue with Discontinuity Tag and Low Bitrate Streams and Seek on iOS 17

I am writing to report an issue encountered with the playback of HLS (HTTP Live Streaming) streams that I believe is specific to iOS version 17. The problem manifests when certain conditions are met during the playback of concatenated HLS segments, particularly those with low video bitrate. Below, I will detail the background, symptoms, and steps required to reproduce the issue.

Background:

Our business scenario requires concatenating two HLS playlists, referred to as 1.m3u8 and 2.m3u8, into a single playlist 12.m3u8. An example of such a playlist is as follows:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:YES
#EXT-X-TARGETDURATION:2
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:2.0,
1.1.ts
#EXTINF:2.0,
1.2.ts
#EXTINF:2.0,
1.3.ts
#EXT-X-DISCONTINUITY
#EXTINF:2.0,
2.1.ts
#EXTINF:2.0,
2.2.ts
#EXT-X-ENDLIST

Problem Symptoms:

On PC web browsers, Android devices, and iOS versions 13 and 15, the following is observed:

  • Natural playback completion occurs without any issues.
  • Seeking to different points within the stream (e.g., from 3 seconds to 9 seconds) works as expected.

However, on iOS version 17, there is a significant issue:

  • Natural playback completion is unaffected.
  • When seeking to various points within the first playlist (1.m3u8) after playing for 1, 2, or 3 seconds, the audio for the last 3 seconds of 1.m3u8 gets lost.

Conditions for Replication:

The issue only arises when all the following conditions are satisfied:

  1. The video content is generated from a single image and an audio track, ensuring sound presence in the final 3 seconds.
  2. The video stream bitrate is below 500 Kbps. (Tested with 1393 Kbps bitrate, which did not trigger the issue.)
  3. The HLS streams are concatenated using the #EXT-X-DISCONTINUITY tag to form a virtual 11.m3u8 playlist. (No issues occur when streams are not concatenated.)
  4. Seek operations are performed during playback. (No issues occur without seek operations.)
  5. The issue is exclusive to iOS version 17. (No issues reported on iOS versions 13 and 15.)

Disrupting any one of these conditions results in normal playback behavior.

Steps to Reproduce:

  1. Using FFmpeg, generate a video from a single image and an audio track, with a suggested duration of 10 to 20 seconds for testing convenience.
  2. If the video's bitrate exceeds 1000 Kbps, consider transcoding it to 500 Kbps or lower to avoid potential edge-case issues.
  3. Convert the 1.mp4 file into 1.m3u8 using FFmpeg. The segment duration can be set to between 1 and 5 seconds (tested with both 2-second and 5-second durations).
  4. Duplicate 1.m3u8 as 2.m3u8, then concatenate 1.m3u8 and 2.m3u8 into 12.m3u8 as shown below:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:YES
#EXT-X-TARGETDURATION:2
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:2.0,
1.1.ts
#EXTINF:2.0,
1.2.ts
#EXT-X-DISCONTINUITY
#EXTINF:2.0,
1.1.ts
#EXTINF:2.0,
1.2.ts
#EXT-X-ENDLIST
  1. On an iOS 17 device, play 12.m3u8 for 1, 2, or 3 seconds, then seek to any point between 7 and 9 seconds (within the duration of 1.m3u8). This action results in the loss of audio for the last 3 seconds of 1.m3u8.
HLS Playback Issue with Discontinuity Tag and Low Bitrate Streams and Seek on iOS 17
 
 
Q