RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
237 stars 29 forks source link

[macOS 15][iOS 18] Issue with playback of HLS #2034

Closed novavision closed 1 month ago

novavision commented 1 month ago

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Describe the issue Streaming url .m3u8 is not played in Mac Unity Editor and iOS devices despite of we using supported codecs (from AVPro website page). We tried HEVC / H.265 and H.264

Your Setup (please complete the following information):

To Reproduce

  1. Can't share the video url because of NDA but the fact is that tried all iOS/Mac supported streaming codec in m3u8 file format and none of them works. I always get the error: Tried on Mac Unity Editor and iOS devices.

Logs

[AVProVideo] Error: Loading failed.  File not found, codec not supported, video resolution too high or insufficient system resources.
Chris-RH commented 1 month ago
  1. Is it reproducible in a new project, using only the AVPro Video demo scene and running your URL?
  2. Does it work with this stream: https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/master.m3u8
MorrisRH commented 1 month ago

Without access to the media we're unlikely to be able to help diagnose the issue. Apple does provide tools which are very useful to diagnosing issues with HLS, information about them is available here and you can download them from here.

novavision commented 1 month ago
  1. Is it reproducible in a new project, using only the AVPro Video demo scene and running your URL?
  2. Does it work with this stream: https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/master.m3u8

Tried in Demo_MediaPlayer scene using my url and your provided url - same result.

img

I will send you the link by email, but if even your url doesn't works, seems the problem is somewhere else. I am on Macbook Pro M3 btw

wcampospro commented 1 month ago

Hello,

I'm havingt exactly the same issue. This is extremely important for us since we use this with customers in Launch events (only happen once) It does not work on iOS devices or even testing on WebGL when setting up an iOS simulated device:

These are somer of the URLs: (but many other urls, that are also coming from vimeo do not work)

Details:

Errors:

Error: video not supported (errorcode=4) color:red; MediaError {code: 4, message: 'DEMUXER_ERROR_COULD_NOT_OPEN: FFmpegDemuxer: open context failed'}code: 4message: "DEMUXER_ERROR_COULD_NOT_OPEN: FFmpegDemuxer: open context failed"[[Prototype]]: MediaErrorMEDIA_ERR_ABORTED: 1MEDIA_ERR_DECODE: 3MEDIA_ERR_NETWORK: 2MEDIA_ERR_SRC_NOT_SUPPORTED: 4code: (...)message: (...)constructor: ƒ MediaError()Symbol(Symbol.toStringTag): "MediaError"get code: ƒ code()get message: ƒ message()[[Prototype]]: Object

[AVProVideo] Error: Loading failed.  File not found, codec not supported, video resolution too high or insufficient system resources. 

Please help with this ASAP, this is directly affecting our business with customers.


After a lot of testing and trying to figure things out, my team and I have found that this issue only happens when using the 18.x.x+ versions of Safari. If we use chrome (or anything chromium) on iOS and MAC devices, the video replay works, is just the use of Safari that breakes due to codec issues.

Hope this helps.

Chris-RH commented 1 month ago

Hi @wcampospro,

We've been working with the OP via email and have worked out that newer versions of macOS (15+) and iOS were not accepting a small discrepancy in the audio format of the HLS (most likely caused by the process used to create the HLS), which older versions of the OS seemed to play fine.

This may or may not be the case with yours, but it would probably be better if you opened a new issue for yourself and included as much information in it as you can.

novavision commented 1 month ago

I may confirm that audio playlist issue fix solved the problem and I could play HLS streamed videos on iOS device and Unity MacOS editor

Chris-RH commented 1 month ago

Thanks @novavision, I'm glad its sorted now :)

MorrisRH commented 1 month ago

Unfortunately the issue is caused by a change in Apple's CoreMedia framework related to how URIs in manifest files are handled. It would appear that certain characters that are not URL safe can no longer be used and require replacing with their percent encoded equivalents. In the OP's case one of their manifest files had paths containing '{' and '}' which required converting to %7b and %7d respectively.

As this is happening at OS level there is nothing we can do about this. Hopefully Apple will resolve this issue in a future OS update.