Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

SCTE-35 is a standard used in the cable television industry to signal the insertion of targeted advertising content within a video stream. The SCTE-35 ad marker is used to indicate the start and end of an ad insertion opportunity within a live stream.

  • In HLS (HTTP Live Streaming), SCTE-35 ad markers are inserted into the .m3u8 playlist file that is used to serve the video stream. The markers indicate the location of an ad break within the stream, and the ad server can then dynamically insert an ad into that break.
  • By including SCTE-35 markers within the .m3u8 playlist, it allows for the live stream to be dynamically updated with new ads, providing a flexible and scalable solution for targeted advertising in live streams.


The below code reads a .m3u8 playlist file, extracts the times of the segments, and sorts them into an array of AdMarker structures. The code then scans the playlist, and whenever the time of the next ad marker is less than the time of the current segment, an SCTE-104 ad marker #EXT-X-CUE-OUT is inserted into the output file, with a duration of 30 seconds and a URI pointing to the next segment.

...