LoginSignup
1

More than 3 years have passed since last update.

MediaLive+MediaPackageで自動フェイルオーバー

Last updated at Posted at 2019-12-27

結論

Input Loss ActionPAUSE_OUTPUTBlackout Slateをdisableにしたらできる。

↓MediaPackageのプレビューのキャプチャ。切り替わりはかなりスムーズ。
failover.gif

あった

この記事を書き終わったタイミングでQiitaで見つけた。こっちを見てくれ。
AWS MediaLiveの「Input Loss Action」に要注意!

やりたいこと

2018/8にリリースされた、MediaLiveのinputs冗長構成で自動フェイルオーバーをやりたい。

MediaLiveでinputを2本(main/sub)にして、outputをMediaPackageのEndpoint 1つにできるようになってた。
[アップデート] AWS Elemental MediaPackageがLive Channelの冗長入力に対応しました

それ以前はCloudWatch => SNS => Lambdaとかでどうにかmain/subを切り替えていたので、勝手にやってくれたらめちゃ楽。

分からん

↑の記事にある通り、

  1. MediaLiveのChannelを一度Stop、Startし直してからOBS Stduio側配信先を変えても、MediaPackageの1つのEndpointで映像を視聴しつづけることができた(映像の一時的な中断はあり)
  2. MediaLiveのChannelのステータスはrunnningのままOBS Studioでの配信先を変更した場合、MediaPackageから配信される映像は黒の映像が流れ続けた(切り替わらなかった)

こうなってしまった・・・。

ドキュメントには、

AWS Elemental MediaLive で HLS グループを使用する場合は、HLS グループの設定で、サービスで入力が受け取られない場合の入力損失時のアクションを、出力の一時停止に設定する必要があります。入力が失われたときに MediaLive がブラックフレームまたは他のフィラーフレームを送信すると、MediaPackage はセグメントが失われたときを判断できず、したがってフェイルオーバーを実行できません。
https://docs.aws.amazon.com/ja_jp/mediapackage/latest/ug/what-is-flow-ir.html

とあるので、ブラックフレームが流れないようになっていればフェイルオーバーしてくれそう。
が、General settings > Blackout Slateをオフにしててもダメ。分からん。
スクリーンショット 2019-12-27 12.31.56.png

結局

Output > HLS settings > Input Loss ActionPAUSE_OUTPUTにする必要もあった。
スクリーンショット 2019-12-27 12.35.18.png

EMIT_OUTPUTPAUSE_OUTPUTがあって、Infoを見るとこう。Infoとは一体。
スクリーンショット 2019-12-27 12.39.35.png

ドキュメントを真面目に漁ると出てくる。出てくるので自分のせいである。それはそう。

・If the channel is a standard channel (to support input redundancy on AWS Elemental MediaPackage), set this field to PAUSE_OUTPUT. With this setup, if MediaLive stops producing output on one pipeline, MediaPackage detects the lack of content on its current input and switches to the other input. Content loss is minimized. (If you set this field to EMIT_OUTPUT, MediaLive sends filler frames to MediaPackage. MediaPackage doesn't consider filler frames to be lost content, and therefore doesn't switch to its other input.)
・If the channel is a single-pipeline channel, set this field to EMIT_OUTPUT. In this way, if the pipeline fails in MediaLive then AWS Elemental MediaPackage continues delivering to its own downstream system (although the content will be filler frames). If you set this field to PAUSE_OUTPUT, AWS Elemental MediaPackage stops updating its endpoint, which might cause problems at the downstream system.
https://docs.aws.amazon.com/medialive/latest/ug/hls-group-fields.html

愚痴

EMITの方がそれっぽくないですか???

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1