Chapter 12.  Add a channel information service

Table of Contents

Send announces when streaming with VLC
Send announces for the programs streamed by VLS with the mini-SAP-server
Start VLC(s) on the client(s)

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 224.2.127.254 reserved for this purpose). On the client side, VLCs receive these annouces and automatically add the programs announced to their playlist.

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.

Send announces when streaming with VLC

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

% vlc -vvv input_stream --sout '#standard{access=udp,url=239.255.12.42,sap,name="Test Stream"}' --ttl 12

where video1.xyz is the file you want to stream, 239.255.12.42 is the multicast IP address you want to stream on, Test Stream is the name that will be used for this program in the SAP announces and 12 is the value of the TTL (Time To Live) of the stream and of the SAP announces.

To do the SAP announces in IPv6, just add the sap_ipv=6 option:

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

Send announces for the programs streamed by VLS with the mini-SAP-server

Note

The mini-SAP-server is only available for Linux and Mac OSX.

Install the mini-SAP-server

Download the latest version of the mini-SAP-server from the streaming download page.

Install-it:

% tar xvzf miniSAPserver-version.tar.gz
% cd miniSAPserver-version
% ./configure
% make

Configure the mini-SAP-server

Edit the configuration file sap.cfg 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.

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

Run the mini-SAP-server

Start the mini-SAP-server:

% ./sapserver -c sap.cfg

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

% ./sapserver -d -c sap.cfg

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

Start VLC(s) on the client(s)

  • If the announces are sent in IPv4 :

    % vlc -vvv --extraintf sap
    
  • If the announces are sent in IPv6 :

    % vlc -vvv --extraintf sap --sap-ipv6
    

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 !