<?xml version="1.0" encoding="UTF-8"?>
<chapter id="dvb"><title id="tdvb">
Diffuser une chaine DVB (Satellite ou TNT)
</title>




<note><para>
Cela est uniquement possible sous GNU/Linux.
</para></note>

<sect1><title>
Installer les drivers DVB
</title>

<para>
Si vous voulez pouvoir diffuser depuis une carte DVB (carte satellite ou TNT), vous devez installer les drivers DVB.

</para>

<itemizedlist>

<listitem><para>

if you use a Linux 2.6.x kernel, you just need to
select the right modules in your kernel configuration.

</para></listitem>

<listitem><para>

Si vous utilisez un noyau linux 2.4.x, vous devez telecharger la dernière version des drivers DVB depuis la page <ulink url="http://www.linuxtv.org/download/dvb/">DVB drivers download</ulink> du projet <ulink url="http://www.linuxtv.org/">LinuxTV</ulink>.

</para></listitem>

</itemizedlist>
<para>
The following sections assume that you have a working linux-dvb installation,
either from stock kernel 2.6 or from kernel 2.4 with DVB patches. If you
have any problem with the linux-dvb drivers, please report the problem
to the maintainers of the drivers, not to us. Thanks.
</para>

</sect1>

<sect1><title>
Diffuser avec VLC
</title>

<note><para>
VLS is currently deprecated and hasn't been maintained for years. It is
strongly advised to use VLC instead, which now supports the same features
as VLS, and many more. The only advantage of VLS is to support the dvbrc
file syntax, and it requires a bit less CPU horsepower. However, we do
not support VLS any longer.
</para></note>

<para>
Mettez un fichier <filename>.dvbrc</filename> contenant les chaines DVB (Staellite ou TNT) que vous désirez diffuser dans votre repertoire personnel (certains sont fournis dans le tarball <emphasis>libdvb</emphasis> pour chaines satellite.
</para>

<para>
Lancez VLS avec la ligne de commande suivante :
</para>

<screen>
<prompt>% </prompt><userinput>vls -vv -d udp:192.168.0.42 dvb:"EUROSPORT" --ttl 12</userinput>
</screen>

<para>
où :
</para>

<itemizedlist>

<listitem><para><emphasis>"EUROSPORT"</emphasis> est la chaine que vous voulez diffuser comme ecrit dans votre fichier <filename>~/.dvbrc</filename> ,</para></listitem>

<listitem><para><emphasis>192.168.0.42</emphasis> est l'un ou l'autre :</para>

<itemizedlist>
<listitem><para>
l'adresse IP de la machine vers laquelle vous voulez émettre en
unicast;
</para></listitem>

<listitem><para>
ou le nom DNS de la machine vers laquelle vous vous voulez émettre
en unicast;
</para></listitem>

<listitem><para>
ou une adresse IP multicast.
</para></listitem></itemizedlist>

</listitem>

<listitem><para><emphasis>12</emphasis>
est la valeur du TTL (Time To Live) de vos paquets IP (ce qui
signifie que le flux peut traverser 11 routeurs maximum).
</para></listitem>

</itemizedlist>

</sect1>

<sect1><title>
Diffuser avec VLC
</title>

<note><para>
VLC has many more features than VLS. First you can use the
advanced stream output options such as transcoding and all kinds of
output supports. Second VLC can take advantage of the Common Interface
supported by some DVB adapters to descramble one or several services.
Currently released versions of VLC only support the low-level API so
some adapters won't work (budget-ci cards work, twinhan doesn't).
Some CAM modules aren't compatible with some DVB cards, check the
linux-dvb documentation for more information. So-called "professional"
CAM modules are able to descramble up to twelve services, whereas
customer-oriented modules are often limited to one or two services unless
otherwise specified.
</para></note>

<para>
VLC must be compiled with --enable-dvb and you need the linux-dvb headers
installed in your system. An example command-line is as follows :
</para>

<screen>
<prompt>% </prompt>
<userinput>vlc -vvv --color --ttl 12  --ts-es-id-pid --programs=8508,8505 dvb: \
--dvb-frequency=11739000 --dvb-srate=27500000 --dvb-voltage=13 \
--sout-standard-access=udp --sout-standard-mux=ts --sout \
'#duplicate{dst=std{dst=address1},select="program=8508",dst=std{dst=address2},select="program=8505"}'
</userinput></screen>

<para>
The example above shows the minimum set of options needed to stream out
two services. Here is a list of frontend options, depending on the
frontend type:
</para>

<itemizedlist>

<listitem><para><emphasis>common options</emphasis></para>

<itemizedlist>
<listitem><para>
<emphasis>dvb-adapter</emphasis>
: specifies the adapter to use in case you have several adapters in your
machine (by default use adapter 0)
</para></listitem>

<listitem><para>
<emphasis>dvb-device</emphasis>
: specifies the name of the DVB device to use (should not be needed with
a standard linux-dvb installation)
</para></listitem>

<listitem><para>
<emphasis>dvb-srate</emphasis>
: specifies the symbol rate of the modulated signal, in symbols/s
</para></listitem>

<listitem><para>
<emphasis>dvb-inversion</emphasis>
: specifies whether the signal is inverted or not (default is automatic
detection)
</para></listitem>

<listitem><para>
<emphasis>dvb-budget-mode</emphasis>
: enters a special mode where all PIDs are retrieved by the driver; it
should no longer be necessary as VLC should filter wanted PIDs
</para></listitem>
</itemizedlist>

</listitem>

<listitem><para><emphasis>satellite frontend (QPSK)</emphasis></para>

<itemizedlist>
<listitem><para>
<emphasis>dvb-frequency</emphasis>
: specifies the frequency to tune to in kHz; according to the frequency
range, VLC auto-detects the band to use: S (2.5-2.7 GHz), C-lower (3.4-4.2 GHz),
C-higher (4.5-4.8 GHz), Ku (10.7-13.25 GHz) or direct BIS frequency (0.95-2.15
GHz); it is mandatory to supply the <emphasis>dvb-srate</emphasis> option
to satellite frontends
</para></listitem>

<listitem><para>
<emphasis>dvb-voltage</emphasis>
: specifies the voltage to apply on the IF; most LNBs behave differently
when supplied with 13 V or 18 V; universal LNBs select vertical
polarity with 13 V and horizontal with 18 V; you can also select 0 V if
your LNB has another power supply (default is 13 V)
</para></listitem>

<listitem><para>
<emphasis>dvb-tone</emphasis>
: specifies whether to send a 22 kHz pulse tone to the LNB; universal
LNBs switch to high-band when this pulse is sent; by default VLC automatically
adopts the correct behaviour if the frequency supplied is in the Ku
band (other bands do not need this)
</para></listitem>

<listitem><para>
<emphasis>dvb-fec</emphasis>
: specifies the code-rate to use for Forward Error Correction; type in
the first number of the code-rate, for 2/3 use --dvb-rate=2, etc. (default
is 9, meaning automatic detection)
</para></listitem>

<listitem><para>
<emphasis>dvb-high-voltage</emphasis>
: enables a special mode of the DVB adapter to compensate for the
voltage loss in very long cables (AFAIK it is present in the API, but
no DVB adapter actually implements it)
</para></listitem>

<listitem><para>
<emphasis>dvb-lnb-lof1, dvb-lnb-lof2, dvb-lnb-slof</emphasis>
: specifies the frequencies of the first and second local oscillators,
and the frequency at which the 22 kHz pulse should be activated to enable the
second oscillator; by default VLC uses the values for universal LNBs
if the frequency supplied is in the Ku band (other bands do not need
this)
</para></listitem>
</itemizedlist>
</listitem>

<listitem><para><emphasis>cable frontend (QAM)</emphasis></para>

<itemizedlist>
<listitem><para>
<emphasis>dvb-frequency</emphasis>
: specifies the frequency to tune to in Hz; it is mandatory to supply the
<emphasis>dvb-srate</emphasis> option to cable frontends
</para></listitem>

<listitem><para>
<emphasis>dvb-modulation</emphasis>
: specifies the modulation of the analog signal; valid values are
-1 (QPSK), 0 (automatic QAM, default), 16 (QAM16), 32 (QAM32), 64 (QAM64)
128 (QAM128), 256 (QAM256)
</para></listitem>
</itemizedlist>
</listitem>

<listitem><para><emphasis>terrestrial frontend (OFDM)</emphasis></para>

<itemizedlist>
<listitem><para>
<emphasis>dvb-frequency</emphasis>
: specifies the frequency to tune to in Hz; it is mandatory to supply the
<emphasis>dvb-bandwidth</emphasis> option, all other parameters are optional
</para></listitem>

<listitem><para>
<emphasis>dvb-bandwidth</emphasis>
: specifies the bandwidth of the OFDM channel (6, 7 or 8 MHz depending
on the country)
</para></listitem>

<listitem><para>
<emphasis>dvb-hierarchy</emphasis>
: specifies if the OFDM channel uses hierarchic information; allowed
values are -1 (no hierarchy), 0 (automatic, default), 1, 2 and 4
</para></listitem>

<listitem><para>
<emphasis>dvb-code-rate-hp, dvb-code-rate-lp</emphasis>
: specifies the code-rate to use for higher and lower hierarchies
respectively (default auto, same syntax as <emphasis>dvb-fec</emphasis>)
</para></listitem>

<listitem><para>
<emphasis>dvb-guard</emphasis>
: specifies the guard interval; valid values are 0 (automatic, default),
4 (1/4), 8 (1/8), 16 (1/16) and 32 (1/32)
</para></listitem>

<listitem><para>
<emphasis>dvb-transmission</emphasis>
: specifies the transmission mode; valid values are 0 (automatic, default),
2 (2K) and 8 (8K)
</para></listitem>
</itemizedlist>

</listitem>

</itemizedlist>

<para>
We also ought to explain the other non-dvb-specific options of the
example command-line:
</para>

<itemizedlist>

<listitem><para>
<emphasis>ts-es-id-pid</emphasis>
: this option is necessary if you use the <emphasis>#duplicate</emphasis>
stream output filter
to split the multiplex in several outputs; there is no need to use
<emphasis>#duplicate</emphasis> neither <emphasis>ts-es-id-pid</emphasis>
if you have one program only
</para></listitem>

<listitem><para>
<emphasis>programs, program, sout-all</emphasis>
: there are several ways of specifying the services to select (and
optionally descramble):

<itemizedlist>
<listitem><para>
<emphasis>programs</emphasis>
: used to specify one or serveral programs to select; VLC selects all
known elementary streams of these programs; this is the currently
recommended way
</para></listitem>

<listitem><para>
<emphasis>program</emphasis>
: used to specify one program to select; it differs from using
<emphasis>programs</emphasis> with only one program in that this
option only select the first audio stream, and no subtitle stream; it
should be used if you plan to switch programs and audio with a GUI
</para></listitem>

<listitem><para>
<emphasis>sout-all</emphasis>
: tells VLC to select all programs; this is discouraged because of
the extra CPU load needed to demultiplex unwanted programs, and
because it is not compatible with CAM descrambling
</para></listitem>
</itemizedlist>

</para></listitem>

<listitem><para>
The other options are standard stream output options and are described
in the other chapters of this documentation.
</para></listitem>

</itemizedlist>

</sect1>
</chapter>

