Closed mbakumenkov closed 9 months ago
I've been researching this for a while and was assuming it was a bug in Safari. ABR is working properly in all players except Safari. And if you play with ?_HLS_legacy=YES after OME's LLHLS URL, ABR appears to work normally.
I still don't know what trick I need to use to get this to work properly. Do you have a URL where ABR works properly in Safari using another streaming server? If so, it would be very helpful if you could provide it.
Below is the LL-HLS demo URL provided by Apple. On my iOS Safari, this always plays at 488 kbps. In comparison, it plays at 2Mbps on PC /Chrome /demo.ovenplayer.com. What does your iOS Safari play with?
https://ll-hls-test.cdn-apple.com/llhls4/ll-hls-test-04/multi.m3u8
@getroot it plays maximum quality as i can see
@getroot but i believe best example of a stream i saw that improves in Safari is it https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/master.m3u8
@getroot it plays maximum quality as i can see
I think 488Kbps is lowest quality. Your Safari plays the lowest quality, just like mine.
And unfortunately, https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/master.m3u8
is not a LL-HLS URL, it is just legacy HLS URL.
on reload it does like this. so it still can improve, but we have the problem that it's never 720 for our streams.
After some time it will drop back to 488 or if you reload it will drop to 488. My and my colleagues' 5 iPhones always behave this strangely. I don't think OME can improve this yet.
How can I see the information box floating in the middle of the player in your screenshot?
@getroot on safari mac-os you also can put a url and it work similar to iOS, but it has tooltip with information
As far as I know, iOS Safari and MAC Safari are quite different. And since MSE is supported on MAC Safari, you have an alternative to using other players. However, iOS Safari does not support MSE, so this is obviously a problem.
Anyway, I've been analyzing this for quite some time, and so far I don't have any ideas on how to improve it on the OME side. To temporarily resolve this, I often create multiple playlists and serve them by generating LLHLS URLs for each quality.
If anyone has any ideas on how to improve this, please let me know. I hope iOS Safari supports MSE as soon as possible. Alternatively, I'd love for them to reveal more details about how the player in iOS Safari works.
I think I've figured out a way to bypass Safari's LLHLS ABR problem. It will be patched in the next week or so.
After a lot of analysis and testing, it is very likely that this is a bug or non-implementation in iOS Safari. It appears that they are not doing Bandwidth Estimation properly when loading media with #EXT-X-PRELOAD-HINT.
Sometimes they don't use #EXT-X-PRELOAD-HINT and then it plays just fine at highest quality. I saw this and thought there was a way to get around it. In fact, if you do not use partial segments using ?_HLS_legacy=YES, Safari plays the video well at the highest quality.
I'll look into it a little further, but this is very likely out of my control. I'm spending too much time on this.
@getroot any chance we could report it to Apple?
i made request to apple, I've choose Webkit as source of problem (but i'm not sure it's correct :DDD) i sent them link to this discussion and hope someone from apple will look on our discussion and maybe join it
I added a special option called <EnablePreloadHint>true</EnablePreloadHint>
. The default value is true. Setting this to false OME will not add #EXT-X-PRELOAD-HINT to the playlist. This will also make ABR work properly in iOS Safari. But the delay will be longer.
From this I am guessing that Safari is doing bandwidth estimation wrong or not implemented when loading PRELOAD-HINT. When a player loads a PRELOAD-HINT, the server must block the request until the resource is ready and respond with the resource all at once as soon as it is ready. Therefore, players must measure bandwidth from the moment the first byte is received, not from the moment of request. THEO Player appears to do this well. hls.js does not yet use PRELOAD-HINT. But Safari seems to be doing this wrong.
You can test this with the master branch and configuration below:
<Publishers>
<LLHLS>
<EnablePreloadHint>false</EnablePreloadHint>
<ChunkDuration>0.5</ChunkDuration>
<PartHoldBack>1.5</PartHoldBack>
<SegmentDuration>6</SegmentDuration>
<SegmentCount>10</SegmentCount>
<CrossDomains>
<Url>*</Url>
</CrossDomains>
I just installed iOS 17.2 Beta3 and tested it. Surprisingly, I found that the problem was resolved in this version. It plays well with high quality rendition.
This is fixed in iOS 17.2, so close. If you need further discussion, please start a new thread on the Discussion board.
Describe the bug LL-HLS streams on Apple devices played only in lowest quality even with good network conditions although there are no such problems on other windows/linux/android devices with the same stream.
To Reproduce Just open a LL-HLS link from safari browser or paste in LL-HLS player (e.g. OvenPlayer or TheoPlayer)
Expected behavior Stream is played in highest quality provided by playlist or at least switches to high quality after some time
Logs Please upload the entire OvenMediaEngine.log. You may delete important personal information.
Server (please complete the following information):
Player (please complete the following information):
Additional context My Server.xml
OBS encoder settings:
I also tried with ChunkDuration 0.2, SegmentDuration 6 - same result :(