注意
本文只针对GNU/Linux.
要从DVB卡串流的话,必须先安装驱动程序(译者注:这不是废话吗?)
以下章节假定你已经安装好了2.6内核或者2.4内核的DVB驱动补丁. 如果安装出现问题的话,联系驱动开发者,谢谢.
注意
VLS已经被遗弃,多年没有人维护了. 强烈建议安装VLC,它有着跟VLS同样甚至更多的功能. VLS唯一的优势在于支持dvbrc的语法和低一些的CPU占用率. 可是VLS已经不在支持和维护了.
在home目录下放置 .dvbrc
文件,在里面配置好卫星或者地面数字电视的频道 (有些可能在 libdvb 的tar包中已经配置好卫星的频道).
在命令行中运行 :
%
vls -vv -d udp:192.168.0.42 dvb:"EUROSPORT" --ttl 12
其中:
-
"EUROSPORT" 是你在
~/.dvbrc
文件中配置的频道 , -
192.168.0.42 可以是以下几种选择 :
-
单播的目标主机地址;
-
单播的目标主机域名;
-
多播地址.
-
-
12 是你的IP包的生存周期TTL,也就是该IP包能通过的路由数为11.
注意
VLC有着比VLS更多的功能. 第一,VLC提供了更多的串流时的高级选项,像转码和各种高级的输出支持. 第二,VLC能够使用一些DVB适配器的通用接口以提供一种或多种的服务. 现在最新版本的VLC只支持底层的API,所以一些DVB适配器可能不能协同工作. 一些CAM模块和DVB卡不兼容,详见它们的linux-dvb文档. 所谓的专业级的CAM模块能够解扰至多12路服务,而定制的模块只能解一到两路服务,除非特别指定.
编译VLC的时候必须指定 --enable-dvb 且系统中必须安装 linux-dvb 头文件. 下面是一个命令行启动DVB串流的例子 :
%
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=rtp{dst=address1,mux=ts},select="program=8508",dst=rtp{dst=address2,mux=ts},select="program=8505"}'
上述例子是输出两路点播服务的最简单的配置. 下面是前端DVB的配置列表, 根据不同的DVB有所不同:
-
通用选项
-
dvb-adapter : 当你的系统拥有多个适配器的情况下,指定特定的适配器(默认是0号适配器)
-
dvb-device : 指定DVB设备的名称(并不需要标准的linux-dvb安装,这个意思要自己体会,我也不知道怎么表达)
-
dvb-srate : 指定符号率(单位符号每秒)
-
dvb-inversion : 指定信号是否倒相,默认是自动检测
-
dvb-budget-mode : 过滤需要的PID,因此VLC不再需要过滤
-
-
卫星接收卡 (QPSK)
-
dvb-frequency : 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 dvb-srate option to satellite frontends
-
dvb-voltage : 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)
-
dvb-tone : 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)
-
dvb-fec : 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)
-
dvb-high-voltage : 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)
-
dvb-lnb-lof1, dvb-lnb-lof2, dvb-lnb-slof : 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)
-
-
有线接收卡 (QAM)
-
dvb-frequency : specifies the frequency to tune to in Hz; it is mandatory to supply thedvb-srate option to cable frontends
-
dvb-modulation : 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)
-
-
地面数字电视接收卡 (OFDM)
-
dvb-frequency : specifies the frequency to tune to in Hz; it is mandatory to supply thedvb-bandwidth option, all other parameters are optional
-
dvb-bandwidth : specifies the bandwidth of the OFDM channel (6, 7 or 8 MHz depending on the country)
-
dvb-hierarchy : specifies if the OFDM channel uses hierarchic information; allowed values are -1 (no hierarchy), 0 (automatic, default), 1, 2 and 4
-
dvb-code-rate-hp, dvb-code-rate-lp : specifies the code-rate to use for higher and lower hierarchies respectively (default auto, same syntax as dvb-fec)
-
dvb-guard : specifies the guard interval; valid values are 0 (automatic, default), 4 (1/4), 8 (1/8), 16 (1/16) and 32 (1/32)
-
dvb-transmission : specifies the transmission mode; valid values are 0 (automatic, default), 2 (2K) and 8 (8K)
-
另外,命令行中还有些不是DVB特定的选项应该解释一下:
-
ts-es-id-pid : 如果你使用了#duplicate 将复用的流过滤到几个输出,那么这个选项是必须的指定的; 如果流中只有一路节目,则没必要使用#duplicate 和 ts-es-id-pid 选项
-
programs, program, sout-all : there are several ways of specifying the services to select (and optionally descramble):
-
programs : used to specify one or serveral programs to select; VLC selects all known elementary streams of these programs; this is the currently recommended way
-
program : used to specify one program to select; it differs from using programs 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
-
sout-all : 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
-
-
其他选项是标准的串流选项,可以在本文的其他章节查阅。