How to Stream Local Video Using OBS and Mistserver
With only a single server, it's possible to stream video from any local source to a website with an embedded player.
To do this, you will need 3 things.
- Server
- OBS (Open Broadcaster Software)
- Mistserver
OBS and Mistserver are open source software that are free to download.
Mistserver Setup
Visit the following to get the version of Mistserver that you would like to use.
Once you have the installer, or you've run the install command, you'll want to set up Mistserver as a service if you are using Linux.
Mistserver as a SystemD service
To set this up as a systemd service, run the following code:
curl http://mistserver.org/mistserver.service -o /etc/systemd/system/mistserver.service systemctl enable mistserver.service systemctl start mistserver.service
Mistserver as an initd Service
To set this up as an initd Service, run the following code:
curl http://mistserver.org/mistserver.init -o /etc/init.d/mistserver chmod +x /etc/init.d/mistserver service mistserver start
Configuring Mistserver
Once you've set up the software, you will need to configure it to be able to accept a push stream.
To get started, you may want to review the documentation on specific usage, but most of the configuration is done through the web interface.
To get logged in, you can use the following in your browser
http://<ip address of server>:4242
You will want to log in using the password you created during the setup process.
Inside of the Management interface after you've logged in, you will want to click on Streams.
Next, click on Create a new stream
Choose any stream name, and use the following for your Source:
push://<ipaddress of local computer or other stream source>
This will whitelist that IP and allow it to push a stream to the server.
Make sure to copy the RTMP Stream Key for the next step.
Click Save and then on the next screen click Embed to get the code needed to put the stream onto your website.
Paste the embed code onto your website and then you're ready for the next step.
Download and Set up OBS
Visit the following link to download OBS
After downloading and installing OBS, you will need to create a scene to stream.
Once you have created a scene, go to Settings then Stream.
In Stream change the stream type to Custom Streaming Server
Use the URL and Stream Key you got from the previous step after settings up Mistserver. Once the settings are in, hit Apply
When you're ready to stream, hit the Start Streaming button in OBS and it will push the stream to your Mistserver.
Viewing the Stream
After you've embedded the stream and started the stream with OBS, you can view it directly using the link provided in Mistserver or through the embedded player.
The embedded player will automatically start or stop the footage depending on whether or not OBS is streaming or not.