Setup RTMP application for live streaming
In latest Niostreamer release 0.2.4 we implemented a couple of new features.
In this article we will talk about application concept. We will describe what is the application itself and how it can be setup in Niostreamer using control panel.
Applications is a main part of streaming. It's abstraction level to tune settings for different streaming scenarios in the same instance of Niostreamer. There is a couple of settings you can set up, in this article we show how protocols can be enabled for different applications.
When Niostreamer is up and running you can stream over RTMP/RTSP protocols to it. Those protocols are converted then into HLS/MPEG-DASH protocols. Also you can play the incoming stream over RTMP.
The incoming RTMP eendpoints can be looked like this:
The pattern is:
The parameters are as follows:
niostreamer-ip is a public ip address of niostreamer instance
rtmp-port is a port for RTMP protocol set in control panel
application-name name of application for this scenario
stream-name an arbital name of stream
To start streaming to
rtmp://22.214.171.124:1935/my-live/my-stream-123 you MUST create a protocol handler for RTMP that will ba available on 126.96.36.199:1935 TCP port and create an application with the name
Create protocol handler
Protocol handler enables user or broadcaster to start video streaming into the specific port using corresponding protocol.
One protocol handler can have many ports enabled.
Open a streaming instance page we want add protocol handler to:
Then go to Protocols section and click "Add protocol handler" button
In dialog select "RTMP" protocol and enter arbital name for this handler
Once added open protocol handler page:
Click "Add network interface"
In opened dialog enter listening ip address "0.0.0.0" and port "1935":
We're done! Now we have new RTMP handler that listen for RTMP streams on all interfaces and port 1935. You can add many listeners or many different handlers:
Open instance page and then open "Applications" section:
Click "Add Application" to open dialog:
In the dialog appeared enter application name and enable protocols you need. In this example we enable only RTMP as we are not going to convert (transmux) RTMP streaming packets to HLS or MPEG-DASH protocols. You can also enable RTSP or MPEG-TS transports for this application.
We are ready to go! Right now we have application and protocl handler registered. We can use ffmpeg utility to start streaming RTMP to Niostreamer instance:
Using ffplay we can view the video: