Skip to main content

Using RTMP with MistServer

Traditional RTMP

Traditionally RTMP works with 2 concepts.

  • Application
  • Stream name

Normally what you set up is an application to which verified users can generate a stream name. Those are generated when they're attempted and all they need to do is push a valid application to generate a stream name. Typically that means that RTMP works as follows:

rtmp://serveraddress:port/application/streamname

Where

  • serveraddress:port is used to connect to the server on the RTMP port
  • application is used to go to the correct category of streaming. For example a specific user or type of video like "live" or "vod".
  • streamname is used to select the stream specifically within the application.

What does MistServer do differently?

Application is ignored or used as a passphrase

Application is meant to categorize the streams on the server end. Generally as a user you will be told to simply copy over this part and generally you wouldn't care what it is. It's something that can be used on the server end to determine how the stream should be treated.

MistServer started out only with stream name as a method to differentiate between streams. Application did not exist and wouldn't make much sense as even between multiple applications the stream name needed to be unique. So instead within MistServer application is simply ignored, or used as a simple password check to allow for pushing.

What does this mean

Frankly, if you are not familiar with how RTMP works this means absolutely nothing as there's nothing to get used to. If you are used to RTMP on other servers the only change you need to get familiar with is that instead of application/stream_name you only identify RTMP streams through stream name and that every stream name should be truly unique no matter the situation.

How do you use RTMP with MistServer

Within MistServer RTMP can only be used as a push input. Which means that in order to use RTMP you will first need to set up RTMP as protocol within the protocol panel. Afterwards set up a stream with the following source syntax:

push://[host][@passphrase]

Both the source host and the passphrase are optional. An incoming push will have to match at least one of the two to be allowed push access to the server, as well as the stream name.

  • The [host] may include a subnet mask, in CIDR notation (e.g. 192.168.0.0/16 will allow the complete 192.168.X.Y range to push). This even works with hostnames, but be aware the same CIDR mask will apply both to IPv4 and IPv6 if your hostname has records both address types!

  • The [passphrase] may include any character allowed in URLs, however some characters might not be valid due to the specifications of a protocol. Therefore we recommend avoiding the following characters: ! # $ & ' ( ) * + , / : ; = ? @ [ ]

Once set up simply push towards MistServer using the following syntax:

rtmp://mistserver[:port]/[passphrase]/[streamname]

Where:

  • mistserver is the address of the server running MistServer
  • port is given if the default RTMP port of 1935 is not used
  • passphrase if given should match, if not then anything is accepted
  • streamname should match the stream name within MistServer you're trying to push towards.

Examples

Assuming that MistServer runs on a server address of 123.456.789.123

Stream nameSourcePortaddress pushing to MistServerRTMP URL to use
livepush://1935452.785.274.182rtmp://123.456.789.123/anything/live
mystreampush://@pasphrase8555452.785.274.182rtmp://123.456.789.123:8555/passphrase/mystream
livestreampush://452.785.274.182@passphrase21935456.123.789.123rtmp://123.456.789.123/passphrase2/livestream
livestreampush://452.785.274.182@passphrase21935452.785.274.182rtmp://123.456.789.123/anything/livestream

RTMP extended spec

Currently there are plans on extending the RTMP specification with modern protocols, most likely this will mean that RTMP will stick around for even longer and will stay relevant as one of the more common user to server protocols. We will implement this extended specification as soon as it is at a point where implementation makes sense.