Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] SGAI integration #1577

Open
mkochman opened this issue Oct 15, 2024 · 3 comments
Open

[QUESTION] SGAI integration #1577

mkochman opened this issue Oct 15, 2024 · 3 comments

Comments

@mkochman
Copy link
Contributor

Hi,
I have a question about SGAI integration, what is the best approach to integrate that with RxPlayer?
So far I parse mpd to get periods and ads but then I need to do a call loadVideo with ad.
Is there any better way than this? I've tried with segmentsLoader overwrite and separately downloaded ad as buffer array and pass it as next segment, but it doesn't work.
I will appreciate for help ;)

@peaBerberian
Copy link
Collaborator

Hi,

I've vaguely heard of SGAI but as it wasn't a subject for us until now, I'm not sure of what it implies for an MSE player.
I guess it makes use of multiple Periods and perhaps xlinks, which for the most part we already support, but I don't know much else and it also seems to rely on specific SCTE 35 events in the MPD.
Do you have an example stream?

Do you know of other players handling SGAI, so we may see what they did to support it?

@mkochman
Copy link
Contributor Author

mkochman commented Nov 8, 2024

So far it is something new for me too :D
So far about sample stream I cannot provide it, we have some test sample that is created inside company and not available outside :(
I know that Bitmovin handling SGAI but their code is not public :(
Also streaming company like Disney is using SGAI 🤔

@mkochman
Copy link
Contributor Author

Ok, I have something, about SGAI integration and player integration sample, shaka player:
https://github.com/shaka-project/shaka-player/blob/7f8b4c82678363d5ea902d6f0e6e17873d13ab06/lib/ads/interstitial_ad_manager.js
some, I will say primitive way of doing that, because it seems they are creating multiple instances 🤔
About docs:
https://dashif.org/docs/IOP-Guidelines/DASH-IF-IOP-Part5-v5.0.0.pdf
https://dashif.org/docs/EventTimedMetadataProcessing-v1.0.2.pdf
https://developer.apple.com/streaming/GettingStartedWithHLSInterstitials.pdf
cta-wave/dash-hls#32
https://youtu.be/NsGuuG4hLKM?si=3C7zTQ2TjM3mgORN
https://youtu.be/BzR0Q4lmKVw?si=AyOusfwQjnAN2sK0

Some structures samples, they can be 100% right and it is more a mock:

Example with live playback: when the presentation time-point reached 60 seconds, an event is dispatched to change to a different manifest pointed by the URL in Event's CDATA.

<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" 
     profiles="urn:mpeg:dash:profile:isoff-live:2011" 
     type="dynamic" 
     mediaPresentationDuration="PT0H4M3.2S"  
     minBufferTime="PT1.5S">
  <BaseURL>http://example.com/content/</BaseURL>
  <Period id="period1" start="PT0S">
    <AdaptationSet>
      <ContentComponent contentType="video" id="1"/>
      <!-- ... Segment information goes here ... -->
    </AdaptationSet>
    <EventStream schemeIdUri="urn:mpeg:dash:event:alternativeMPD:2022" value="insertURL">
      <Event presentationTime="60000000" duration="10000000" id="1">
        <![CDATA["http://example.com/alternative/dash_ad_playlist.json"]]>
      </Event>
    </EventStream>
  </Period>
  <!-- ... More periods, if available ... -->
</MPD>

Example VOD (based on Shaka code): two 5 second long interstitials, one at 10s and one at 20s. This example shows that json could be embedded directly in the manifest:

<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.5S" type="static" mediaPresentationDuration="PT30M">
  <Period id="1" duration="PT30M">
    <AdaptationSet mimeType="video/mp4" codecs="avc1.42E01E" width="640" height="360" frameRate="30">
      <SegmentTemplate timescale="1000" media="segment_$Number$.m4s" initialization="init.mp4" duration="2000"/>
      <Representation id="1" bandwidth="500000"/>
    </AdaptationSet>
    <EventStream schemeIdUri="urn:mpeg:dash:event:2012" timescale="1">
      <Event presentationTime="10" duration="5" id="1">
        <![CDATA[
          {
            "uri": "https://example.com/ad1.m4s",
            "startTime": 10,
            "endTime": 15,
            "isSkippable": true,
            "skipOffset": 2
          }
        ]]>
      </Event>
      <Event presentationTime="20" duration="5" id="2">
        <![CDATA[
          {
            "uri": "https://example.com/ad2.m4s",
            "startTime": 20,
            "endTime": 25,
            "isSkippable": false
          }
        ]]>
      </Event>
    </EventStream>
  </Period>
</MPD>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants