Adding SCTE-35 for Live Encoding

How to Add SCTE 35 to your live stream.

Step One - Basic RTMP Live

Familiarise yourself on creating a RTMP Live Encoding

Step Two - Updating the Manifest Generator

Now that you know RTMP Live encoding we can update the code in rtmp-live-encoding.
Update this code snippet per the inline comments

start_live_encoding_request = StartLiveEncodingRequest(
        dash_manifests=[live_dash_manifest],
        hls_manifests=[live_hls_manifest],
        stream_key=stream_key,
        manifest_generator=ManifestGenerator.V2 , # <------- add this to use V2 ManifestGenerator
auto_shutdown_configuration=auto_shutdown_configuration
    )

Step Three - Insert SCTE 35

Now you’ll have a RTMP Live stream running successfully and a EncodeId i.e YOUR-ENCODING-ID

Call the Bitmovin API
https://api.bitmovin.com/v1/encoding/encodings/YOUR-ENCODING-ID/live/scte-35-cue
with a sample payload of

{
  "cueDuration": 10
}

This adds a SCTE 35 cue tone into the live stream.

CURL command line sample; Replace ALL-CAPS with your own values.

curl -X 'POST' \
  'https://api.bitmovin.com/v1/encoding/encodings/YOUR-ENCODING-ID/live/scte-35-cue' \
  -H 'accept: application/json' \
  -H 'X-Api-Key: YOUR-API-KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "cueDuration": 8
}'

That’s ALL !

Now you should see your SCTE markers in your HLS manifest. Similar to

0/video/720p/segment_41.m4s
#EXTINF:4.0,
0/video/720p/segment_42.m4s
#EXTINF:4.0,
0/video/720p/segment_43.m4s
#EXT-X-CUE-OUT:8.0
#EXTINF:4.0,
0/video/720p/segment_44.m4s
#EXTINF:4.0,
0/video/720p/segment_45.m4s
#EXT-X-CUE-IN
#EXTINF:4.0,
0/video/720p/segment_46.m4s
1 Like