Triggering an input switch when the user stops streaming?

0

Hi there,

I'm wondering if this can be accomplished in MediaLive.

Say you want to play a "post-roll" or "outro" video after the user stream ends. But since the stream is live, you don't really know when is the exact time it will end. So, is it possible to trigger an "immediate" input switch not at a particular time, but when MediaLive stops receiving the upstream signal?

asked 3 years ago166 views
1 Answer
0

chrisatmb

This is possible, but the transition won't be seamless, since you have to take into account potential interruption to the source feeding into MediaLive. You would not want to switch to the post-roll content for a small hiccup on the input to MediaLive.

One solution would be to a lambda to monitor the logging from the MediaLive channel, and if it sees a log entry indicating source issue into MediaLive and that log entry does not get cleared in a user-defined period (e.g. 30 sec) then the lambda can do the input switch schedule action to switch over to the post-roll input.

  1. Enable logging in the channel. https://docs.aws.amazon.com/medialive/latest/ug/enabling-disabling-logs.html
  2. Look at the log messages being generated for your input type, and select from that which to be sent to the lambda.
  3. In the lambda create a trigger of type CloudWatch Logs and select the ElementalMediaLive log, set the filter name and set the pattern to the MediaLive channel ID and the text to the log message you determined to use for this effort.
  4. Now the lambda will be able to receive the log entries specific to the input loss, i.e. were the log message is asserted. The lambda should wait for a period of time, that you can define, to receive a Clear message for this asserted message, and if it does not receive the clear message within in that time frame it would initiate the Input switch (Immediate Mode) to the the post-roll input attached to that MediaLive channel.
answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions