Use VLC to build a Streaming Media Server
The VLC open-source project is quite powerful. We can use it as the playback core for secondary development and as a high-performance streaming media server. This blog focuses on using VLC to build a Streaming Media Server.
The procedure for VLC to build a Streaming Media Server is simple: select the input data, select the output format, select the encoder, and select the streaming traffic. There are many sources of input data, such as local files, network streams, audio, and even images. The encoder selects the Audio Encoder and video encoder to determine the sound output quality and image quality; the output format is large. It can be a local file, a network stream, or a multicast. The stream flux is currently retained, which is of little use. The following example uses the RTSP stream of the camera as the input and RTSP as the output:
Select input data:
Select the output format, encoder, and streaming:
Click stream to enable VLC on the local machine or PC in the same LAN as the local machine. Enter RTSP: // (streaming ip address): 8554 to play the video immediately. The effect is as follows:
The command line for the preceding operation is: sout = # transcode {vcodec = h264, acodec = mpga, AB = 128, channels = 2, samplerate = 44100}: rtp {sdp = rtsp: //: 8554/}: sout-all: sout-keep
In Linux, you can use the vlc-vvv command to stream data. For more information, enter vlc-h for help.
Note: When streaming into a UDP stream, add the IP address you want to play the video at 192.168.66.11. You should select 192.168.66.11 as the output address, when playing the video on 192.168.66.11, you only need to enter UDP // @ (the port number you selected) to play the video. It must be accessible on the same LAN. Otherwise, you must use NAT to access the video, either access through VPN, but the principle is to access in the same LAN.