The signal must first be encoded to provide audio or video content via streaming over the internet. Streaming encoders are used for this purpose. The encoded signal is then transmitted to an RTMP server using RTMP. The protocol also has the task of transmitting the encoded signals to a content delivery network or an online video platform. Exactly how this transmission takes place depends on the RTMP variant used.
The standard variant of the network protocol uses TCP via port 1935 as the transport protocol. First, data blocks are exchanged between client and server. This process is also called handshake. This way, the server is told which protocol version is being used. In addition, a time stamp is sent to the server. The connection can be established as soon as the server informs that it has received these two data blocks and when.
To do this, the client sends a connect request in action message format to the server and then waits for a confirmation from the server. When the client has received this, the client can start real-time streaming.
This establishes a persistent connection that can be used to transmit data in real time. The streaming data is transmitted in blocks of different sizes. For video data, the block size is 128 bytes, for audio data 64 bytes. The latency of RTMP is relatively low due to the use of TCP.
Another variant of the Real Time Messaging Protocol is RTMPT based on HTTP. Here, a tunneling technique is used to bypass firewalls. RTMPS based on HTTPS works similarly.
From the RTMP server, the stream can also be transmitted directly to end devices using HLS.