Sunday, November 11, 2018

Live Video Broadcasts to Internet and Local Network with RTMP

There are times when we want to stream to the internet (YouTube, Facebook, or some other service), or to the local network, or both. We use OBS Studio for both, so we'll use two RTMP streams.

To stream to an internet service, set up OBS with your streaming key the usual way. There are plenty of tutorials for that, such as this one. The "Start Streaming" button in OBS then allows you to stream to that service.

To stream to computers (and/or digital signage) on the local network though, we use the "Start Recording" button. Run a program called MistServer, either on your OBS computer or on another one. Then in OBS go to Settings, Advanced, Recording and select "Custom Output (FFmpeg)" and "Output to URL". As the File path or URL put  rtmp://ip_address_of_MistServer/live/your_stream_key  and set the container format to flv.

Now the "Start Recording" button starts the stream to your MistServer, and other computers on the local network can watch the stream from http://ip_address_of_MistServer:8080/your_stream_key.webm in Chrome or Firefox.

Sorry if this is a little thin on details, in a future post I'll write more about this setup and how to use Screenly (and balenaCloud) to stream to digital signage.