/streamRIP

Fallback to backup stream if main stream goes offline

Primary LanguageShellMIT LicenseMIT

streamRIP

streamRIP is a simple set of bash scripts for use with the NGINX RTMP module.

It provides a "fallback" stream for when a main stream disconnects, so the stream never truly goes offline on the client side.

Requirements

Configuration

Configuration is done in config.sh, there are a few things you must change in this file:

  • rtmpi_fallback

    The back upped stream which play when main stream goes down. The stream should be as close as possible to the same encoding parameters as your actual stream, including resolution and bitrate.

  • rtmpe

    The RTMP endpoint to stream to, this would be the server of whatever service you're streaming on, for Twitch it would look something like rtmp://live-abc.twitch.tv/app/{stream_key}

  • rtmpi

    The RTMP ingest server, this is the stream streamRIP will pull from as the "main" stream. You usually won't have to change this if you're using the provided streamRIP NGINX config.

Installation

Copy the script into a location nginx will be able to read. The suggested and default location is /usr/share/nginx/streamRIP/

If you install the script somewhere besides the default location, you will have to update the streamrip.conf file with the proper script location.

After the scripts are copied and updated if needed, copy the streamrip.conf to the location where your NGINX config file is located, you can either replace it entirely with the streamRIP config file, or transfer the rtmp section into an existing config file.

Usage

After NGINX is started, you can set your live streaming program to stream to rtmp://{ip}/live, with your stream key set to the secret value you included in config.sh. {ip} should be the IP of the server NGINX is being hosted on.

Once you start streaming, your stream should begin on the streaming service.

If you go offline during the stream, the video you specific in config.sh will begin to loop until you go back online or NGINX is shut down.