Audio Live Streaming using a 5G Network
In this section, we will be looking at utilizing the deployed 5G Network for live audio streaming. Because of the very small latency and increased bandwith over other past mobile network technologies such as 4G, 5G can offer near realtime audio streaming with optimum quality. For this example we will be utilizing the Real Time Streaming Protocol (RTSP) where we will have one of the UEs running a RTSP server with a broadcast and second UE as a listener. Since we cannot hae audio or video outputs on AWS server, we will have the second UE restream the broadcast back to an open port on the AWS server and then connect to that particular port from our local machine. The overall system is shown in the below diagram.
Configuring Live Transmission
For the transmission we need to have two UEs, one transmitting the audio stream and at least one recieveing the stream. For this purpose we can use the same two UEs we previously deployed during the Initial Network Connection. Once two UEs are deployed and running, we need to open a terminal window inside the UE, for this purpose click attach shell on both the UE containers as shown below.
Now we can set up one container as the transmitter and the other as the receiver.
Transmitter
For the streaming, we will be using ffmpeg software and the RTSP server package, which is already installed on our UE docker image. You can use the following command to start the stream on the server.
Next, open another terminal on the same UE and tun the following command to initiate the stream through the ffmpeg software.
Next we need to get the ip address of our transmitting UE so that other UE users can connect to the stream for listening. To obtain the ip address please type ifconfig in the terminal and you will get ip address information as shown below. In this case our IP address is 12.1.1.2
Receiver
Now that we have our server streaming the audio file, we need to listen to that stream from the second UE and re stream it to the open AWS port. For this also, first start the RTSP server by typing the following command on the terminal
Next we are going to listen to the stream coming from the firt UE and then re-stream it into the second UE's localhost RTSP port so that we can connect to it from outside. Note that you have to replace the IP address in the command with the IP address of the transmitter UE. The command for this is as follows:
ffmpeg -re -stream_loop -1 -i rtsp://12.1.1.2:8554/Test_Audio -c copy -f rtsp rtsp://localhost:8554/Test_Audio
Listen from the local machine
Now you can listen to the stream using your local machine. For this open VLC on your computer and enter the following address on the network stream address or type the following command on the terminal.