LDP/LDP/ref/docbook/VideoLAN-Quickstart/vlc-streamoutput.sgml

114 lines
4.1 KiB
Plaintext

<chapter id="vlc-streamoutput"><title id="tvlc-streamoutput">Stream and receive with VLC</title>
<sect1><title>Unicast an MPEG-1, MPEG-2, or MPEG-4 / DivX file</title>
<simplesect><title>Start VLC on the server</title>
<para>Open a terminal and type :</para>
<screen>
<prompt>% </prompt><userinput>vlc /media/video/video1.avi --sout udp://client.example.org</userinput>
</screen>
<para>where <filename>/media/video/video1.avi</filename> is the file
you want to stream and <emphasis>client.example.org</emphasis> is the
DNS name of the client you want to stream to (you can put an IP address
instead).</para>
<note><para>Under Windows, make sure that you are in the same directory
as the VLC install directory.</para></note>
<simplesect><title>Start VLC on the client</title>
<para>Launch VLC on the machine which receives the stream and click on
the <emphasis>Net</emphasis> button. Then select <emphasis>UDP</emphasis>,
keep the default port and click on <emphasis>OK</emphasis>.</para>
<sect1><title>Unicast a DVD</title>
<simplesect><title>Start VLC on the server</title>
<para>Open a terminal and type :</para>
<screen>
<prompt>% </prompt><userinput>vlc dvdold:/dev/dvd --sout udp://client.example.org</userinput>
</screen>
<para>where <filename>/dev/dvd</filename> is the device corresponding
to your DVD drive (put <filename>D:</filename> under Windows if
<filename>D</filename> is the letter of your DVD drive) or the directory
where you copied your DVD, and <emphasis>client.example.org</emphasis>
is the DNS name of the client you want to stream to (you can put an IP
address instead).</para>
<note>
<para>
Under Unix/Linux, you must have write access to the device
corresponding to your DVD drive. For that, you should be in the
<emphasis>disk</emphasis> or <emphasis>cdrom</emphasis> group (look
at the permissions in <filename>/dev</filename>). If you're not, add
yourself to the group :
</para>
<screen>
<prompt># </prompt><userinput>adduser your_login disk_or_cdrom</userinput>
</screen>
<para>and then restart your session.</para>
</note>
<simplesect><title>Start VLC on the client</title>
<para>Use the same procedure as in the previous section.</para>
<sect1><title>Multicast to several VLC's</title>
<simplesect><title>What is multicast ?</title>
<para>Multicast is a norm implemented in all modern network hardware
(switches, routers, ...). It provides an intelligent manner to send a
stream to a dynamic group of machines. If you want to use multicast,
make sure that all your network hardware support it.</para>
<para>In multicast streaming, the stream is sent to a multicast IP
address (the IP addresses reserved for this purpose are from 224.0.0.0
to 239.255.255.255). Then, any machine on the network can join the
multicast group by sending a request on the network, and it will
automatically receive the stream. When it sends a request to leave the
group, it will automatically stop receiving the stream. The advantage
of multicast streaming is that only the machines that want to receive
the stream actually receive it, and the streaming server only sends one
stream even if there are multiple clients receiving it.</para>
<simplesect><title>Start VLC on the server</title>
<para>Open a terminal and type :</para>
<screen>
<prompt>% </prompt><userinput>vlc /media/video/video1.avi --sout udp://239.255.12.42 --ttl 12</userinput>
</screen>
<para>where <filename>/media/video/video1.avi</filename> is the file you
want to stream (remplace it with <emphasis>dvdold:/dev/dvd</emphasis>
under Unix or <emphasis>dvdold:D:</emphasis> under Windows if you want
to multicast a DVD), <emphasis>239.255.12.42</emphasis> is the multicast
IP address you want to stream on and <emphasis>12</emphasis> is the
value of the TTL (Time To Live) of your IP packets (which means that the
multicast stream will be able to cross 11 routers).</para>
<simplesect><title>Start VLC(s) on the clients</title>
<para>Launch VLC and click on the <emphasis>Net</emphasis>
button. Then select <emphasis>UDP Multicast</emphasis>, type
the multicast IP address, keep the default port and click on
<emphasis>OK</emphasis>.</para>
</sect1>