Recognising ad markers #EXT-OATCLS-SCTE35 tag in HLS Live stream

Hi,


How to recognize #EXT-OATCLS-SCTE35: tag in live HLS playlist and also maniest has other custom tags. I have tried using timedMetadata property of AVPlayerItem , KVO approach. But its not notifying the presence of this tag.


Can someone help me in implementing this.


Regards,

Santhosh

The #EXT-OATCLS-SCTE35 tag (and the #EXT-X-SCTE35 tag) are not recognized by Apple parsers. They will be ignored as comments.


The only Apple supported way of including SCTE-35 data is via the EXT-X-DATERANGE tag with the various SCTE35 attributes.

The daterange tag was made public with draft-pantos-19 and is supported in iOS 9.3 and beyond.


See the spec for the details - https://tools.ietf.org/html/draft-pantos-http-live-streaming

See also the WWDC 2016 video - What's New in HTTP Live Streaming - https://developer.apple.com/videos/play/wwdc2016/504/ which talks about the various ways metadata can be included in HLS streams.


Hi sw_mechanic,


Thanks for the answer. Is there any way where I can extract HLS manifest info which is requested by AVPlayer and I can parse it from app. Otherwise I have to make request from app for the same manifest again to identify custom tags, which will end up in having two requests for manifest , one from AVPlayer and another from app(parser).

Can you guide me here in implementing this.


Regards,

Santhosh

First, let me strongly encourage you not to go this way.


You can't peek into what AVPlayer is doing. It's not intended to let you do that and I think it is technically not feasible.


If you feel compelled to extract this non-standard information then I think your only option would be to the AVAssetResourceLoader functionality so that all the playlist fetches were going through your code. If I were doing this, I would on-the-fly convert the non-standard EXT-OATCLS-SCTE35 to EXT-X-DATERANGE tags, so that the system could deliver it appropriately. Trying to separately sync it up with the playback would be ugly and probably would never work right.


But, my preference would be to fix the streams so they don't include these non-standard tags in the first place.

Hi sw_mechanic


I know you're saying it is non standard, but I need to fetch all the playlist regarding a different case.


I'm uncertain how to do this via AVAssetResourceLoader? Could you provide a minor example?



Thanks,

Nam

Hi Nam,


Want to check if you got a solution for identifying custom tags in the playlist

Hi Gangadhar


Unfortunately no.


I found a that I observe timed metadata in the stream, but I still need help for accessing custem tags in the playlist.


Best,

Nam

Hello Media Engineer,
Thanks you I managed to get the SCTE-35 data from the EXT-X-DATERANGE tag. But I have the following problem: how do I know exactly when ad event should start to play?
Let me explain with an example:

AVPlayer plays an HLS stream with the EXT-X-DATERANGE tags inserted to indicate the beginning of the ad playing back.
Code Block
#EXTINF:10.000,
video 30.ts
#EXT-X-DATERANGE:ID="001",START-DATE="2021-01-04T09:57:00.032Z",PLANNED-DURATION=30.000
#EXTINF:10.000,
video 40.ts

  1. How to determine that the player finished to play the first media tag (video 30.ts) and it needs to show ads?

  2. I also understand that the EXT-X-DATERANGE tag is about UTC only, and not rely on the tags between which it is located, but what mechanism for determining the start time of advertising works in this case?

  3. And what happens if the HLS stream freezes due networks issues before the ad starts? How does UTC calculating work in this case?

I will be very grateful for any help.
Recognising ad markers #EXT-OATCLS-SCTE35 tag in HLS Live stream
 
 
Q