Set up VLC streaming media service

Source: Internet
Author: User
Tags rfc
Overview:

Streaming Media Technology is a technology that allows multimedia data streams to be transmitted from the server to the client over the network, while the receiver receives and plays the video.

Requirements for network services:

  1. Data must be transmitted in real time and only a small delay (several hundred milliseconds) is allowed );
  2. Transmission data is relatively reliable, and a certain amount of data loss is tolerated;
  3. Bandwidth is guaranteed to ensure that the transmitted data volume can be played in real time.
Set up a VLC-based UDP Server

UDP (User Datagram Protocol) is a connectionless transport layer protocol in the OSI reference model. It provides a simple and unreliable information transmission service for transactions. It is a simple datagram-oriented transport layer protocol, which corresponds to the connection-oriented TCP protocol.

It is precisely because the UDP protocol does not have TCP congestion control and transmission rate control, nor does it provide data transmission reliability assurance, but it ensures real-time transmission, so it is widely used by streaming media application systems. It is mainly used to support network applications that need to transmit data between computers. network applications, including network video conferencing systems, in many customer/Server modes, all require UDP protocol.

Use VLC (VLC Media Player 1.0.1) to Implement UDP Server:

First, open the VLC player on the server, as shown below:

Next, select the media menu --> advanced open file. The interface is as follows:

Click the Add button to add media files on the disk, and select stream from the drop-down menu in the lower right corner to go to the next step, as shown below:

On the interface above, click the target button to set UDP and add the client you want to send. You can set multiple. In addition, if transcoding is required, enable transcoding options are checked. You can select the default settings for other options without any changes. Of course, you can also configure output as required to go to the next step, the video starts playing on the server and sends stream information to the target.

Next, open the VLC player on the client, click the media menu, and select Open Network streaming. The following page is displayed:

Select UDP protocol, and the port is default. Click the play button to play the video on the client.

The above operations are performed using the graphical interface. Of course, you can also use commands.

 


VLC Server RTSP function implementation

RTSP (Real Time Streaming Protocol) is an application layer protocol in the TCP/IP protocol system. It is an ietf rfc standard submitted by Columbia University, Netscape and RealNetworks. This Protocol defines how one-to-multiple applications can effectively transmit multimedia data over an IP network. RTSP is located on RTP and RTCP in the architecture. It uses TCP or RTP for data transmission. Compared with RTSP, HTTP transmits HTML, while RTP transmits multimedia data. HTTP requests are sent by the client and the server responds. When RTSP is used, both the client and server can send requests, that is, RTSP can be bidirectional.

First, go to the installation directory of the VLC and execute a command similar to the following:

VLC-TTL 12-vvv-color-I telnet-Telnet-Password VideoLAN-RTSP-host 219.219.218.239: 5554

-TTL: indicates the hop restriction. The-vvv option is used to output error information, which can be omitted. 219.219.218.239 indicates the host address of the rstp vod Server; videoLAN is the password entered when you use Telnet to log on to the RTSP On-Demand Server. You can modify the two passwords based on your needs.

Log on to the RTSP On-Demand Server

Here, I use securecrt for telnet login. The interface is as follows:

After you click "Connect", enter the password "VideoLAN" and press Enter. If "welcome" and "master" are displayed, the logon is successful.

In the Host Name field, enter 219.219.218.239. The content must be consistent with the host address of the rtsp vod Server created earlier. In the port field, enter 4212, this port number cannot be changed to another value when you use the default VLC settings.

Next, you can set the on-demand file.

On the logon success page, enter the following command:

New Test VOD Enabled
Setup test input myvideo. mpg

Finally, you can watch the video on the client. The command is as follows:

VLC rtsp: /219.219.218.239: 5554/test

You can also use the vlm of the vlc player for visualized configuration and generation. use the securecrt tool to log on to the RTSP On-Demand Server, use the load command to import the configuration file, and use the show command to view the imported file information.

Test results:

Cdxa/MPEG-PS can be played without encoding conversion, but can only be played with VLC player. The reason is that other players cannot parse the test file name in rtsp: // 219.219.218.147: 5554/test.

Stream Output Using RTP protocol

Real-time transport protocol)It is a network transmission protocol, which was published by the IETF multimedia transmission team in RFC 1996 on March 13, 1889. The RTP protocol details the standard packet formats for transmitting audio and video on the Internet. It was initially designed as a multicast protocol, but was later used in many unicast applications. RTP is often used in streaming media systems (with RTCP protocol), video conferencing and one-click push to talk systems (with H.323 or sip), making it the technical basis of the IP telephone industry. The RTP protocol is used together with the RTP control protocol RTCP, And it is built on the User Datagram Protocol.

Server:

VLC-vvv input_stream-sout '# RTP {DST = 192.168.0.12, Port = 1234, SDP = rtsp: // server.example.org: 8080/test. SDP }'

Client:

VLC rtsp: // server.example.org: 8080/test. SDP

rtp: streams over RTP. This can only be used to stream MPEG-TS over plain RTP.
VLC for mmsh/MMS On-Demand

Microsoft Media Server Protocol (MMS) is a protocol used to access and stream receive. ASF files on Windows Media Servers. The MMS protocol is used to access unicast content on Windows Media publishing points.

Sample Video. mpg format.

VLC-vvv input_stream: sout = # transcode {vcodec = h264, VB = 800, scale = 1, acodec = mp4a, AB = 128, channels = 2, samplerate = 44100 }: STD {access = mmsh, MUX = asfh, DST =: 8080}

Run the following command on the VLC client:Mmsh: // server_ip_address: 8080
In storm audio and video, Windows Media Player can play normally. In kmplayer, the video format is normal, but there is no sound, so it cannot be played in real,
Error cause: the audio cannot be parsed.
In addition, I tested several HD videos (mov, MKV, WMV) and found that they can be played, but they are too slow.
VLC enables HTTP VOD
Place the required media files under a certain path on the server. The server can be Apache or tomcat.
Then, you can use a variety of players on the client to play the video, such as VLC, Windows Media Player, and RealPlayer.
The command is as follows: http: // localhost/filename

If the file is too large, it cannot be played normally, such as my dance. WMV file size: 351 MB, but it can be played under RealPlayer. The buffer time is relatively long and can be played in Windows Media Player for a relatively small buffer time.

Note:

TS: The MPEG2/TS muxer. This the standard muxer used to stream mpeg2. this muxer can be used with anyAccessMethod. Supported codecs are MPEG 1/2/4, MJPEG, h263, h264, i263, WMV 1/2 and theora
For video, MPEG audio, AAC and A52 for theaudio stream.

PS: The MPEG2/PS muxer. this the standard muxer for MPEG 2 files (. mpg ). it can be used with the file and HTTP output methods. supported codecs are MPEG 1/2 and MJPEG for video, MPEG audio and A52 for audio streams.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.