
VLC: Stream and Stream Server # 2

In this part, we will consider “Simple Streaming” through the GUI for housewives , and for example, we will use the following situations:
1. When we act as a local translator, for people with limited Internet, with disconnected Internet, or for those who consider your taste and wants to watch what you recommend to them.
3. If you want to transfer video from your webcam, just a digital camera and any other similar devices, through DirectShow.
If anyone has questions that have already been covered, look at the answers to the topics:
Serious talk about VLC
Serious talk about VLC # 2
VLC: Stream and Stream Server # 1
and
Stable IPTV broadcasting via VLC
Comments:
1. For convenience, in case you will upload a lot of files, I advise you to prepare a playlist in M3U format in advance.
2. In the latest versions of VLC, the stream can be safely configured to broadcast almost all protocols at once, unless of course it is required.
3. For debugging and learning, I recommend starting work with VLC using the “logger” module

vlc -extraintf logger
4. To apply a logo to a stream, use the logo filter , preferably in PNG format.

5. As an alternative player for playing streams with VLC took Windows and Winamp Media Player.
Stream Output Methods
- Play localy: Watching / listening to what you are broadcasting currently supports transcoding, rescaling and so on ... (for local use)
- File : Saves the streamed stream to the hard disk. (suitable if you are relaying something past yourself and want to keep it)
- HTTP / S : Stream stream over HTTP. You must specify the IP address and TCP port.
- MMS / H : Most often used for streaming in Windows Media Player. And it only works with ASF encapsulation method.
- UDP : multicast and unicast (IPv6 support possible). And it only works with TS encapsulation method.
- RTP : Real-Time Transfer Protocol. similar to UDP, and can use unicast multicast addresses at the same time.
- RTMP : Real Time Messaging Protocol - a proprietary streaming protocol, mainly used for streaming video and audio streams from webcams over the Internet. (VLC is only supported as an incoming stream that can be relayed.)
Configure Incoming Data
For all types of broadcasts, the initial GUI dialog looks the same:

File: Just select a playlist or any file (Audio / Video), and depending on what you are going to broadcast to the network.
Disk: DVD. AudioCD VCD, here you can disable the menu output, select the drive, and a chapter.
Network: here we can choose any protocol and address of the incoming stream that we will relay / convert / save (for example, from Youtube), It was also checked yesterday that VLC copes with RTMP streams perfectly, so you can broadcast video from your webcam, which flow goes to any service managed by red5.

Capture device:Here you can choose, if any, any device that works through Direct Show, Camera, Webcam, Digital or Satellite TV, as well as your Desktop (Everything that happens on your screen will be broadcast).

After you have decided on the choice of the incoming stream, just click the “Stream” button. After that, a new dialog box will open, which at the same time works as a stream and / or conversion setting, and the final result depends on the settings made here. Click the Next button , or the Destination tab .
As shown in the figure, and as I already mentioned, we can broadcast over all supported protocols at the same time, in this example I show an example of broadcast over HTTP / MMS.
Select:
New Destination- HTTP, click Add, drive in the address (0.0.0.0, or look at ipconfig), specify the port. If we need more protocols, then just click "+".

Transcoding Options: Choose a transcoding method from ready-made profiles, or create your own (and you can also start a stream without processing for a client VLC).
Having become exhausted with the codecs, I came to the conclusion, and then reading on the network, I realized that I was not alone - transmitting the video stream via mms and http protocols with technical data:
Encapsulation - ASF
Codec - DivX3
Width - 320 (to reduce the load)
Height - 200 (to reduce the load)
Audio - mp3
Bitrate - 96
most optimal for transferring to most players.

: sout = # transcode {vcodec = DIV3, vb = 800, scale = 1, width = 320, height = 200, acodec = mp3, ab = 96, channels = 2, samplerate = 44100}: std {access = mmsh, mux = asfh, dst = 0.0.0.0: 1234}In these cases, testing on 10 clients, the processor load was ~ 5-12%.
The same method can be used for people who don’t have a media player at all, to watch / listen to the stream from your website (local, or if you have an External IP, then this method will also work for a website on the Internet).
To do this, create a document with the extension * .asx, for example stream.asx and put the code there:
Домашний Стрим
Where HREF is your IP and port. Put this file on the server, for example, in the / stream / folder, and in the html file where you would like to display the stream, write the following:
If clients have Mplayer or VLC, then you can play with other types of encapsulations and codecs, such as TS and h264, respectively.

: sout = # std {access = http, mux = ts, dst = 0.0.0.0: 8080}
In this case, we will get less load on the system, more on the channel, but at the same time customers receive the original video.
The next / last Options tab is optional, it’s worth a look only for those who will configure the Announcements, or want to see the generated script that can be used later from the team building, it is also useful if you will start broadcasting on the “Cron”. I already wrote about how to use it.
Click " Stream " for the last time and invite your friends.
Conclusions:The quality of the stream and its reception can only be achieved if there is a VLC or Mplayer on both sides, since in the case of VLC it does not require troubles with plugins and codecs. Everything that it streams by any protocol, it quickly and painlessly picks up on the client side , regardless of codecs and encapsulations and other annoying factors. This conclusion is based only on the fact that the method in question is good for “housewives,” and people who do not know how to use consoles and command lines. In the next part, we will try to reveal the topic and broadcasting capabilities based on the “Command Line”, which increase the range of streaming capabilities.
PS: If you have problems with network availability,
1. Check the Firewall, Proxies, File C: \ **** \ VideoLAN \ VLC \ http \ .hosts for uncommented lines
:: / 0 0.0.0.0/0
UPD: To transmit a stream over UDP unicast
from the server side, you must specify the IP and destination port. For example:
Server (192.168.0.1), Client (192.168.0.2)
On the server in the streaming settings, specify
Media - Stream - UDP, 192.168.0.2:1234
For the client to view the stream:
Media - Open Network Stream - UDP, @: 1234
UDP Multicast
In multicast, the stream is broadcast to multicast IP addresses ( IP addresses reserved for these purposes, the range of which is from 224.0.0.0 to 239.255.255.255 ). Then, any machine on the network can join the multicast group, sending a request to the network, it will automatically receive the broadcast stream.
Then it sends a request to stop playback of the stream and leaves this group. The advantage of multicast stream is that only those machines that want to receive it receive the stream, and the server broadcasts only one stream, which is received by all members of the group.
Activation of multicast occurs as in the case of unicast, only in the Options tab you need to specify the number of TTL * (for example, 50) IP packets. This means that the multicast stream can cross 50 routers.
* - Time To Live
And from the client’s side, it’s enough to simply open the stream in any player that supports multicast and specify
udp: // @ _ IP_: port in the stream name line Multicast related
links
on Wikipedia
IP Multicast on the Cisco website
We will examine multicast in more detail in the topic of advanced streaming using the command line and telnet