sap.xml 4.18 KB
Newer Older
Clément Stenac's avatar
Clément Stenac committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
<?xml version="1.0" encoding="iso-8859-1" ?>

<chapter id="sap"><title id="tsap">
Add a channel information service
</title>
<para>Typing multicast addresses is not very fun... that's why you need
a channel information service ! VideoLAN has implemented a channel
information service based on the SAP/SDP standard. The SAP announces
about the multicast programs are sent on the network (via the multicast
address <emphasis>224.2.127.254</emphasis> reserved for this purpose).
On the client side, VLCs receive these annouces and automatically add
the programs announced to their playlist.</para>

<para>VLC can send the SAP announces associated with the programs
it is streaming. VLS can't do that, but an independant program, the
mini-SAP-server, can send the announces for the programs sent by
VLS.</para>
<sect1><title>
Send announces when streaming with VLC
</title>

<para>
To send announces with VLC, you need to use the complex syntax of
VLC's stream output, like this:
</para>

<screen>
<prompt>% </prompt><userinput>vlc -vvv input_stream --sout '#standard{access=udp,url=239.255.12.42,sap,name="Test Stream"}' --ttl 12</userinput></screen>
<para>where <filename>video1.xyz</filename> is the file you want
to stream, <emphasis>239.255.12.42</emphasis> is the multicast IP
address you want to stream on, <emphasis>Test Stream</emphasis> is
the name that will be used for this program in the SAP announces and
<emphasis>12</emphasis> is the value of the TTL (Time To Live) of the
stream and of the SAP announces.</para>

<para>
To do the SAP announces in IPv6, just add the
<emphasis>sap_ipv=6</emphasis> option:
</para>

<screen>
<prompt>% </prompt><userinput>vlc -vvv input_stream --sout '#standard{access=udp,url=239.255.12.42,sap,name="Test Stream",sap_ipv=6}' --ttl 12</userinput>
</screen>

</sect1>

<sect1><title>
Send announces for the programs streamed by VLS with the
mini-SAP-server
</title>
<note><para>
The mini-SAP-server is only available for Linux and Mac OSX.
</para></note>

<simplesect><title>
Install the mini-SAP-server
</title>
<para>
Download the latest version of the mini-SAP-server from the <ulink
url="http://www.videolan.org/streaming/">streaming download page</ulink>.
</para>

<para>
Install-it:
</para>

<screen>
<prompt>% </prompt><userinput>tar xvzf miniSAPserver-version.tar.gz</userinput>
<prompt>% </prompt><userinput>cd miniSAPserver-version</userinput>
<prompt>% </prompt><userinput>./configure</userinput>
<prompt>% </prompt><userinput>make</userinput>
</screen>

</simplesect>

<simplesect><title>
Configure the mini-SAP-server
</title>
<para>Edit the configuration file <filename>sap.cfg</filename> shipped
with the tarball. It should contain a global section with the Time To
Live (TTL) and the IP version (IPv4 or IPv6) used for the SAP announces
and a section per program announced. Use the comments to understand each
parameter.</para>

<para>The Time To Live option indicates the maximum number of routers
that the SAP announce packets can cross before being dropped.</para>
</simplesect>

<simplesect><title>
Run the mini-SAP-server
</title>

<para>
Start the mini-SAP-server:
</para>

<screen>
<prompt>% </prompt><userinput>./sapserver -c sap.cfg</userinput>
</screen>

<para>
If you want to run the mini-SAP-server in the
background, use the <command>-d</command> command line switch. For
instance:
</para>

<screen>
<prompt>% </prompt><userinput>./sapserver -d -c sap.cfg</userinput>
</screen>

<para>
You can also omit the <command>-c</command> 
command line switch if your config file is <filename>/etc/sap.cfg</filename>.

</para>

</simplesect>
</sect1>

<sect1><title>
Start VLC(s) on the client(s)
</title>

<itemizedlist>

<listitem><para>
If the announces are sent in IPv4 :
</para>

<screen>
<prompt>% </prompt><userinput>vlc -vvv --extraintf sap</userinput>
</screen>

</listitem>

<listitem><para>
If the announces are sent in IPv6 :
</para>

<screen>
<prompt>% </prompt><userinput>vlc -vvv --extraintf sap --sap-ipv6</userinput>
</screen>

</listitem>

</itemizedlist>
<para>Then open the playlist: you should see the names of the programs
announced in SAP. When you double-click on the name of a program,
VLC will subscribe to the multicast address and start to play the stream
!</para>

</sect1>
</chapter>