Use VLC to build a simple Streaming Media Server (UDP and TCP)

Source: Internet
Author: User

During this time, streaming media data transmission was used.TCPAndUDPMethod, feelingVLCYou can do this.Demo, Which is summarized here for my reference later.

Introduction

VLCHome page:Http://www.videolan.org

VLCNot only a player, but also a Streaming Media Server. I will not talk about the relevant information on the Internet.

DeclareVLCVersion:2.0.3

Use VLC Build based on UDP Streaming Media Server

Most streaming media servers are based onUDPInVLCThere are also several implementations. I will only list the ones I use here.

1 , UDP ( Legacy ) Traditional mode

Server operations

Enable the "media-stream" option ,:

Click "add" to select a streaming media file, and then click "streaming ".

Click "Next" and select"UDP (legacy )"And then click Add.

Enter the targetIPAddress, and select the corresponding encoding type in "transcoding options" (depending on the situation)

You can click "Next" to set the settings, or click "streaming" to set the server. Here, I click "streaming" to complete server settings.

Client operations

Click "media-Open Network streaming" and enter"UDP: // @ 1234"Click play.

Interface operations are relatively simple, but scripts are reliable if such operations are often performed.

Command Line Operation Method

Server (172.16.1.1):

 
VLC-vvv sample1.avi -- sout UDP:172.16.1.100:1234-- TTL10

Client (172.16.1.100):

 
Vlc udp://@: 1234
2 , RTP Method

Although there areTCPOfRTPBut packet capture,VLCOfRTPIs based onUDP.

 

Server operations

The first few steps andUDP(Legacy) The traditional mode "is similar, so we will not repeat it here. Select"RTP/MPEG transport stream"This option ,:

EnterIP, Select Port:

Click "stream" to complete server operations.

Client operations

Click play.

Command Line Operation Method

Server (172.16.1.1):

 
VLC-vvv sample1.avi -- sout"# Transcode {vcodec = h264, VB = 0, scale = 0, acodec = mpga, AB = 128, channels = 2, samplerate = 44100}: RTP {DST = 172.16.1.100, port = 5004, MUX = ts, TTL = 10}" 

Client (172.16.1.100):

 
Vlc rtp://@: 5004
3 , RTSP Method

RTSPThe method is throughRTPFor transmitting streaming media data,VLCIs also based onUDP. In this way, there are many references on the Internet, so I cannot directly describe the operations in the command line mode.

Command Line Operation Method

Server (172.16.1.1):

 
VLC-vvv sample1.avi -- sout"# Transcode {vcodec = h264, VB = 0, scale = 0, acodec = mpga, AB = 128, channels = 2, samplerate = 44100}: RTP {SDP = rtsp: /// 8554/test}" 

Client (172.16.1.100):

 
VLC rtsp://172.16.1.1: 8554/test
Use VLC Build based on TCP Streaming Media Server

VLCOfHTTPThe Streaming Media Server is built usingTCPThis is an example of data transmission.

HTTP Method

This interface operation andRTSP.

Command Line Operation Method

Server (172.16.1.1):

 
VLC-vvv sample1.avi -- sout"# Transcode {vcodec = h264, VB = 0, scale = 0, acodec = mpga, AB = 128, channels = 2, samplerate = 44100 }: HTTP {MUX = FFMPEG {MUX = FLV}, DST =: 8080/test}" 

Client (172.16.1.100):

 
VLC http://172.16.1.1: 8080/test

 Okay, that's all. I hope it will help you.

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.