
Now, the video is being encoded and transferred to the server. Running the above command on the terminal after the streaming server is configured, would look like this: The url is based on the configuration of the streaming server. This is the target RTMP destination for the video. For the RTMP protocol, we need to use the flv (Flash Video) format.

It is an output parameter that defines the output container format of the video. Similarly, here we are specifying the audio encoder Here we are specifying the encoder to be used for the video It is the input video that we are using for the discussion and can be downloaded from here It is most used for live streaming or with a camera input. It is an input parameter that instructs FFmpeg to read the same number of frames per second as the framerate of the input video. Let’s go through the meaning of the parameters used in the above command. Following is the FFmpeg command to encode the video and transfer it to the server.įfmpeg -re -i crowdrun.mp4 -c:v libx264 -c:v aac -f flv rtmp://localhost/show/stream We would be using FFmpeg to encode and send data to the server. The encoder encodes the audio/video using any one of the supported codecs and transfers the data to the RTMP-SERVER using the RTMP protocol. Let’s discuss each of the steps in detail. To have a better understanding of the complete process of video streaming using RTMP, we can represent the steps involved using the following diagram : Steps Involved in RTMP Video Streaming using FFmpeg

It provides a bidirectional message multiplex service and is mainly used to carry the streams of videos, audios and messages. Real Time Messaging Protocol (RTMP) is a TCP-based communication protocol.

