Issue with HLS on iOS devices

I'm having some issues with the generation of HLS (.ts) files. We are working in order to generate an HLS from an RTSP source (ip camera) using ffmpeg. The issues is this one:

  • If we use FFMPEG to generate the HLS we have no issues at all by playing it on macOS, iPadOS and iOS.
  • If we use our internal FFMPEG included inside our software (.exe running on windows) we have some issues with iOS. The HLS won't play only on iOS devices (ipads and macs works like a charm).

We've tried to understand what is the issue but we are not able to dig anything else than something related with Media Source Extensions.

I've included a link to our repo where you can fine both the file generated from our software (streamATC.ts) and the one generated directly from FFMPEG (streamFF.ts) if you want to take a look at it.

Github forum about this issue

Our repo with .ts files

No difference between both files from a codec standpoint as you can see:

Do you have any help in order to understand why of this strange behaviour ?

Accepted Reply

Hi there,

MSE is only supported on macOS and iPadOS, and not iOS (iPhone). So, if you are attempting to use MSE on an iPhone to play back the file, it will not succeed.

Interestingly, QuickTime X on macOS Big Sur is also unable to play back the streamATC.ts file, but can play back the streamFF.ts file no problem, so there's very likely a difference in the contents or header of the file itself that makes it incompatible with playback using AVFoundation.

I am unable to determine what exactly is going on with the file, but when AVFoundation attempts to open the file, it sees no playable tracks, nor can it determine a duration, let alone play back the media. The media likely is corrupt somehow.

If you're unable to determine the root cause, and can ensure that the file is indeed a valid and standards compliant media file, I would encourage you to file a bug report at feedbackassistant.apple.com, attaching the two files, and explaining the issue. Engineering can then try and take a look into why we are unable to open the file.

Thanks!

Replies

Hi there,

MSE is only supported on macOS and iPadOS, and not iOS (iPhone). So, if you are attempting to use MSE on an iPhone to play back the file, it will not succeed.

Interestingly, QuickTime X on macOS Big Sur is also unable to play back the streamATC.ts file, but can play back the streamFF.ts file no problem, so there's very likely a difference in the contents or header of the file itself that makes it incompatible with playback using AVFoundation.

I am unable to determine what exactly is going on with the file, but when AVFoundation attempts to open the file, it sees no playable tracks, nor can it determine a duration, let alone play back the media. The media likely is corrupt somehow.

If you're unable to determine the root cause, and can ensure that the file is indeed a valid and standards compliant media file, I would encourage you to file a bug report at feedbackassistant.apple.com, attaching the two files, and explaining the issue. Engineering can then try and take a look into why we are unable to open the file.

Thanks!

Thank you so much for your answer ... we are going to fix this issue. Have a great day.