In this post we will show how Niostreamer can be installed in Windows. We will setup RTMP server, push MP4 video using ffmpeg and play in with ffplay.
Niostreamer is provided for multiple operating systems. It's cross platform. For now, the native package for Windows is in progress, so we will use Docker to run Niostreamer on Windows.
First, Docker for desktop should be installed from official website
Download the Installer from here: https://desktop.docker.com/win/stable/amd64/Docker Desktop Installer.exe
Follow the steps provided by insteller to prepare Docker for Desktop:
Restart Windows after installation completed:
Create docker-compose.yml with the following content:
version: '3.1' services: niostreamer: image: "niostreamer/niostreamer" hostname: "niostreamer" ports: - "1935:1935"
You will see message in logs:
| | To register instance in control panel please follow the steps: | | 1. Log into your account on https://niostreamer.com | 2. Copy and open this link to activate instance: https://niostreamer.com/activate?token=<TOKEN> |
Register new account in https://niostreamer.com and open this link in you browser
You will see in logs that instance has been registered:
2021-07-23 04:47:46.920236 info [saas] Instance has been registered in control panel
And then you will see the new instance in web panel as well:
Now Niostreamer is ready to accept incoming connections from RTMP clients.
Create RTMP virtual host
In instance overview page press "Add Virtual Host" button
Enter virtual host and port and press "Save"
To start virtual host the listener interface must be created. Open Virtual host page and press "Add Listener"
Enter listening address and port and press "Add"
Wait a little bit until instance is syncronized with control panel. You'll see the virtual host is started in streamer logs:
niostreamer_1 | 2021-06-28 05:22:00.351304 info [live-stream-manager] Application 'live' registered niostreamer_1 | 2021-06-28 05:22:00.351333 info [core] VHost 'rtmp-default' started
Niostreamer has opened TCP port 1935 and is ready to listen for incoming connections.
As a test stream we will use command line utility
ffmpeg. We will try to stream popular video sample used to test video streams called "Big Buck Bunny".
Start the command from your machine:
ffmpeg -re -i C:/video/big-buck-bunny.mp4 -vcodec copy -acodec copy -f flv rtmp://vm.local:1935/live/bunny
Streaming is started now. niostreamer started to receive audio video data. Let's play incoming stream using
ffplay -f flv "rtmp://vm.local:1935/live/bunny" -v verbose
You will see video window playing the target sample.
Niostreamer is a fully functional streaming server. It can convert incoming RTMP streams to other ones, i.e. HLS.
In next articles we will show how to stream RTMP to niostreamer and the share it as HLS to other players.