Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Level 7

How to identify SCTE-35 marker or ID3 tag from Live HLS stream

We need to implement play ads using RAF whileSCTE-35 marker or ID3 tag is detected from the HLS live stream.

We already added timedMetaData listener in Video, but the listener is not calling.

Is there any other listener to identify SCTE-35 marker, any sample URL contains SCTE-35 marker.

Tags (2)
0 Kudos
3 Replies
Highlighted
Level 8

Re: How to identify SCTE-35 marker or ID3 tag from Live HLS stream

Hi,

Did You set "timedMetaDataSelectionKey" field of SG video node?
To recive any timed meta data You need to set this field. example below shows a way to select all keys:

SGVideoNode.timedMetaDataSelectionKeys = ["*"]

For more reading visit this documentation site  and search for "timedMetaDataSelectionKeys ", "timedMetaData " fields.

0 Kudos
Highlighted
Level 7

Re: How to identify SCTE-35 marker or ID3 tag from Live HLS stream

Hi aBlaze,

    Thanks for your reply, I added timedMetaDataSelectionKey for Video node only,

Please check the sample code.

 

<?xml version = "1.0" encoding = "utf-8" ?>

<!--********** Copyright 2016 Roku Corp. All Rights Reserved. **********-->

<component name = "VideoExample" extends = "Scene" >

<script type = "text/brightscript" >

<![CDATA[

sub init()
videocontent = createObject("RoSGNode", "ContentNode")

videocontent.title = "Example Video"
videocontent.streamFormat = "HLS"

videocontent.url = ""
m.video = m.top.findNode("exampleVideo")
m.video.content = videocontent

m.video.setFocus(true)
m.video.control = "play"
m.video.timedMetaDataSelectionKeys = ["*"]

m.video.observeField("timedMetaData", "timedMetaDataChanged")

end sub


Sub timedMetaDataChanged()
print "Position" m.video.Position
print "timedMetaData" m.video.timedMetaData
end Sub
]]>

</script>

<children >

<Video id = "exampleVideo"/>

</children>

</component>

 

0 Kudos
Highlighted
Level 8

Re: How to identify SCTE-35 marker or ID3 tag from Live HLS stream

Hi, srikanth, frankly Yours code worked well for me. 
only thing i have changed it was setting URL.

<?xml version="1.0" encoding="utf-8" ?>

<component name="MainScene" extends="Scene">

    <script type = "text/brightscript" >

    <![CDATA[

        sub init()
            videocontent = createObject("RoSGNode", "ContentNode")

            videocontent.title = "Example Video"
            videocontent.streamFormat = "HLS"

            videocontent.url = "http://playertest.longtailvideo.com/adaptive/wowzaid3/playlist.m3u8"
            m.video = m.top.findNode("exampleVideo")
            m.video.content = videocontent

            m.video.setFocus(true)
            m.video.control = "play"
            m.video.timedMetaDataSelectionKeys = ["*"]

            m.video.observeField("timedMetaData", "timedMetaDataChanged")

        end sub


        Sub timedMetaDataChanged()
            print "Position" m.video.Position
            print "timedMetaData" m.video.timedMetaData
        end Sub
    ]]>

    </script>

    <children >

        <Video id = "exampleVideo"/>

    </children>

</component>

After running channel logs were like this: 

07-16 13:41:02.279 [beacon.signal] |LiveStartInitiate ---------> TimeBase(2187 ms)
07-16 13:41:02.280 [beacon.signal] |LiveStartComplete ---------> Duration(1199 ms), 2.41 KiP
Position 3.286
timedMetaData<Component: roAssociativeArray> =
{
    _decodeInfo_pts: 2.981
    TIT2: "test"
}
Position 8.281
timedMetaData<Component: roAssociativeArray> =
{
    _decodeInfo_pts: 7.996
    TIT2: "test"
}
Position 13.18
timedMetaData<Component: roAssociativeArray> =
{
    _decodeInfo_pts: 13.012
    TIT2: "test"
}
Position 18.582
timedMetaData<Component: roAssociativeArray> =
{
    _decodeInfo_pts: 18.004
    TIT2: "test"
}
Position 23.379
timedMetaData<Component: roAssociativeArray> =
{
    _decodeInfo_pts: 23.007
    TIT2: "test"
}
Position 28.08
timedMetaData<Component: roAssociativeArray> =
{
    _decodeInfo_pts: 28.012
    TIT2: "test"
}

Can You provide example stream url?

0 Kudos