Capturing satellite video¶
For ingesting video streams from a satellite the so-called IRD (Integrated Receiver-Decoder) equipment and headends are used. Flussonic Media Server can receive video over IP protocols from any IRD devices or systems. Also, Flussonic can directly ingest from DVB-S and some other cards.
This article describes various aspects of receiving a signal from a broacast satellite.
In this article:
- Longitude
- Configuring the receiver
- Descrambling
- Choosing the equipment
- Using Flussonic to capture video from DVB-S boards
- Using Flussonic to capture video from TBS ISDB-T Quad boards
- Receiving channels
- Summing up
Longitude¶
Television satellites hang in geostationary orbit above the equator. Their position above the Earth is constant, therefore, the satellites are identified by the longitude they hang at. For example, satellite ABS 2 rotates around the Earth, constantly being above 75° EL.
Geostationary position makes installation of satellite dishes very simple: simply orient it to the desired point and don't rotate the dish.
Since the satellite is over the particular longitude, usually different satellites are used to broadcasting certain sets of channels. For example, satellite Appstar-7 76.5°E is filled with Indian channels, and satellite Galaxy-17 91.0°W is more used for broadcasting channels for the USA.
It is important to note that some satellites have several beams, i.e. the zones of the maximum reception. The channels in the beams may be different. For example, the same satellite may broadcast one set of channels to Russia, and another one to Thailand.
Configuring the receiver¶
Many multiplexers leave the same satellite in the same beam. A multiplexer is a single digital channel, for receiving which it is necessary to configure the capture card to a specific frequency and polarization.
I.e. from the same satellite, multiple frequencies and multiple polarizations are simultaneously broadcast.
Polarization may be left/right, or horizontal/vertical. Household satellite dishes (or rather the heads of these dishes, or converters) are able to receive both polarizations to the same outgoing cable, but do it poorly. Professional converters receive all polarizations, but to different outputs.
This separation is caused by the fact that for switching the reception polarization, the capture card supplies 13 or 18 volts. Below is a polarization and voltage correlation table:
Voltage (V) | 13-14 | 17-18 |
---|---|---|
Linear polarization | vertical | horizontal |
Circular polarization | right | left |
Some receivers specify voltage, and others state polarization. In fact, everything is reduced to supplying voltage.
If a simple splitter is used to join two capture cards and supply 18 V to first of them, and 13 V to the second one, the second one will not receive the signal.
Some receivers can switch off the voltage. In this case, they are to be connected with a splitter to another receiver/capture card that still delivers the voltage.
Frequency bands from the satellite are conventionally divided into top and bottom bands. The border is approximately at 11,700 MHz. When capturing frequencies below 11,700 Mhz, the heterodyne frequency (LNB Frequency) is usually set to 9,750 MHz. When capturing frequencies above 11,700 Mhz, the heterodyne frequency is usually set to 10,600 MHz.
After the wires are connected correctly, without messing up with voltage, the desired frequency is set on the receiver and the heterodyne, and the receiver has automatically selected the FEC (the number of bits to control error) and modulation (QPSK, 8PSK, etc.), the receiver starts receiving the bit stream, i.e. the multiplexer.
The multiplexer is an MPEG-TS stream and makes it possible to pack many channels with different language tracks and subtitles into one stream. A household satellite receiver makes it possible to pick only one channel from the multiplexer, but professional receivers and DVB PCI capture card allow picking all channels from the multiplexer.
The structure of an MPEG-TS stream in the multiplexer will be described in more detail below.
Descrambling¶
Most of the channels on the satellite are broadcast encrypted. Encryption is used to control access to channels of different users: those who have paid for the next month watch TV.
The procedure of decrypting satellite channel is called descrambling, and the encrypted channel itself is called a scrambled channel.
The mechanism of controlling access to the satellite channels is called Conditional Access (CA), in Russian terminology the term "conditional access" is used.
To date, there are various encryption schemes, but basically all modern schemes work approximately as follows:
- the subscriber receives an access card (resembling a large, uncut SIM card with similar chip)
- the access card has a private key
- once a month, the packet key is changed
- the packet key encrypted with the public key of the card is sent to each subscriber via the satellite
- access card remembers the packet key
- the stream key encrypted with the packet key is changed once a minute for each channel
- if the user received a packet key and managed to decrypt it, he can get access to the channel.
This scheme has variations and complications, but conceptually the scheme is like that. If the satellite operator is not paid, at the end of the month he will not send the updated key, and the card will not be able to decipher the channel. From the technical point of view, there is a sad situation with descrambling. Satellite operators and the pirates are engaged in a long and unsuccessful struggle with each other, which affects operators.
When a usual subscriber buys a household satellite dish, he gets an access card and the household satellite receiver with a chip for descrambling one channel according to the encryption scheme that is chosen by the operator. Conventionally speaking, a receiver for NTV+ is not suitable for Continent-TV.
The operator technically cannot use 200 household receivers, so professional receivers are used, which capture all channels from the band, rather than one. However, the official method of descrambling offered by operators involves the use of special CA modules. It is a circuit board similar to the PCMCIA module that the access card is plugged into.
The CA module descrambles channels independently. To do so, it picks up the channels from the head-end station, descrambles them and sends them back.
The problem is that even for a professional CA module, descrambling of 8 channels is an extreme load. Taking into account that many multiplexers today contain up to 30 channels, it turns out that the same multiplexer is to be captured via a splitter several times, using expensive capture cards or the head-end stations.
A detailed description of the process of descrambling on a head-end station, or using a computer, is beyond the scope of this description, especially considering the fact that valid schemes of descrambling should be agreed upon with the content provider, in order not to violate the criminal code.
Choosing the equipment¶
The traditional way of ingesting a satellite broadcast is using so-called head-end stations.
A headend station is a dedicated satellite receiver that can capture more than one channel (up to hundreds).
More expensive head-end stations, such as WISI Compact Headend systems, provide a higher density in comparison with cheaper ones:
Instead of 1-2 multiplexers in a 1U housing, up to 24 ones can be captured. However, one won't be able to descramble all of them, since in this case the number of multiplexers will be reduced to 12 (space is needed for CI modules), and a professional head-end station cannot descramble more than 8-10 channels from the same multiplexer, because it is, essentially, an extremely expensive but a weak computer.
An alternative way is using a PC for capturing from the satellite.
An ordinary PC can adopt up to 7 such cards (the main thing is to find an appropriate motherboard). It should have either 4 outputs, or 2 outputs with a CI module.
When buying such cards, it is very important to check whether they support Linux at the LinuxTV project website. Who would be interested in a card that is only Windows-compatible?
Flussonic supports video streams no matter which equipment was used to ingest them. So the choice of the equipment depends on your budget and technical preferences. Also, you should consider maintenance costs.
To build up a head-end, you can choose a separate hardware solution or a hardware board that you use with an x86 platform.
Hardware solutions are more expensive and less flexible in terms of configuration. To configure them, you are usually limited to using a web interface. To make up for it, vendors of such hardware guarantee stable capacity, long continuous operation, and excellent support.
By contrast, software solutions that you use to manage a hardware board on a computer, are extremely flexible in operation and maintenance. They allow managing their settings through configuration files, and Linux provides rich opportunities for debugging compared with closed-code head-end stations.
You can also capture video from DVB, ATSC, ISDB cards by using Flussonic Media Server.
Capturing from DVB, ATSC, ISDB cards directly to Flussonic¶
You can capture video from DVB, ATSC, ISDB cards directly into Flussonic. To do this, add the board properties in dvb_card and then specify the stream's source through the mpts-dvb:// scheme.
Example:
dvb_card a0 {
system dvbs2;
adapter 1;
frontend 3;
frequency 195028615;
symbol_rate 29500;
polarization v;
modulation qam256;
disabled;
comment "13E high vertical";
}
stream channel5 {
input mpts-dvb://a0?program=1713;
}
Here:
- system (atsc|dvbs2|dvbt2|dvbt|isdbt) — adapter type. The configuring process is similar for any standard. See also example with TBS ISDB-T Quad boards.
- frontend — the board's frontend number
- frequency — the carrier frequency (Hz) of the multiplexer for this channel
- symbol_rate — the symbol rate of the multiplexer
- polarization — the voltage of the multiplexer for this channel
- modulation — the modulation mode
- disabled — the device is not operable
- program — TV channel
Note
Flussonic supports more adapter types but not all of them are tested yet, so their work with Flussonic is not guaranteed. Please refer to the schema for the full list of supported values for the system
parameter.
Configuring DVB ingest settings in the UI¶
All added and enabled DVB cards are listed in Media > DVB cards. For each added and enabled card, the green indicator shows the signal level. Click the Programs link to view the stream structure and select programs for broadcasting in specific streams.
To add a DVB card, go to Media > DVB cards and click Add DVB card. Fill in the card properties:
- Name — DVB card name. By default, the new card name will be newDVBCardN, where N is an index number (starting from 1). You can edit the name.
- Adapter — adapter number. Adapters are numbered in /dev/dvb/adapterN.
- System — adapter type.
- Frequency — the carrier frequency (MHz) of the multiplexer for this channel.
- Polarization — the voltage of the multiplexer for this channel.
- Symbol rate — the symbol rate of the multiplexer.
To open advanced options, click the area with general options (see the arrow on the right).
- Frontend — the board's frontend number. Each adapter has 1-N frontends but usually there is a single frontend whose default number is 0.
- Enabled — use this DVB card.
Other advanced DVB option are:
- Code rate HP — high priority stream code rate.
- Code rate LP — low priority stream code rate.
- Guard interval — the mode of inserting a guard interval — a padding separating transmissions so that they do not interfere with each other.
- Rolloff — rolloff factor, in %. It is used to estimate bandwidth, together with symbol rate.
- Pilot — enable, disable, or autodetect pilot tones.
- Modulation — DVB-C modulation method.
- Hierarchy — constellation ratio for hierarchinal transmission.
- Transmission mode — DVB transmission mode.
- Bandwidth — bandwidth, in Hz.
- Plp stream id — the PLP stream ID; when set, enables DVB-T2 MI unpacking before MPEG-TS decoding.
- Hw — adapter card hardware type.
- Device — modulator number in adapter.
- Serial — serial number of the card.
- Int freq — base frequency, in MHz.
- Compensate time drift PPM — max source's internal clock drift to compensate, rounding to six decimal places.
- Port — port number.
- Attenuator — attenuation of the signal level.
- Interleave — use interleaver. The interlaver disperses sequence of bits in bit stream to minimize effect of burst errors during transmission.
- Gain — adjust the output gain to the specified value in dB.
- Input bitrate — input bitrate, in Mbps.
- Video device — the video device to capture video from Stream Labs SDI/ASI cards. It is actually a path to a device file created on the disk by Video4Linux.
- High band — whether high frequency band is used.
- Comment — any text comment.
The next step is adding a stream with the source mpts-dvb://a0 program=<NUMBER>
. You can do it manually in Media > Streams > Add or automatically on the Programs page (see the description below).
Viewing MPTS structure and adding streams¶
You can now view the structure and service information of a captured MPTS and add a stream for a particular program on your Flussonic.
To view MPTS structure, go to Media > DVB cards and click the Programs link near the green indicator. Here you can see a table listing all programs with PIDs information (how many video, audio, and other tracks a program contains).
Viewing tracks information¶
To view the detailed information about the tracks contained in the program, click the information icon in the PIDs column. For each track you will see a track number, PID, resolution, codec, and bitrate.
Adding a stream for a program¶
To create a stream for a particular program, click the Add button for a corresponding program. Flussonic will create the stream automatically. The source of the stream will look like mpts-dvb://a0 program=<NUMBER>
.
The name of the stream will correspond to the program service name, for example, Euronews_Russian
. If a program has no service name, the stream name will be generated from the DVB card name and the program ID, for example, a0_790
.
Viewing signal information¶
For each program you can view statistical information about the captured signal. To do it, go to Media > DVB cards and click the information icon next to the green indicator.
You can see the following statistic parameters:
- ber — the percent of bit errors from total number of transferred bits (bit error rate).
- has_carrier — carrier detected in the signal.
- has_lock — DVB signal was successfully locked.
- has_signal — a signal is detected above the normal noise level.
- has_sync — synchronization bytes detected.
- has_viterbi — DVB signal was locked at Viterbi decoder stage.
- snr — signal-noise ratio, in percent.
- snr_raw — signal-noise ratio as a raw 16-bit number.
- strength — signal strength, in percent.
- strength_raw — signal strength as a raw 16-bit number.
Note
Please note that the values of signal parameters may vary depending on the device vendor and the DVB card driver.
Passing a stream from a DVB card without processing¶
Flussonic can ingest and pass a stream from a DVB card "as is" without repackaging. For this, use the URL:
tshttp://ADMIN:PASSWORD@FLUSSONIC_IP/flussonic/api/dvbts/[DEVICE_ID]
Example:
dvb_card a0 {
system dvbs2;
adapter 1;
frontend 3;
frequency 195028615;
symbol_rate 29500;
polarization v;
modulation qam256;
disabled;
comment "13E high vertical";
}
stream STREAM_NAME {
input tshttp://ADMIN:PASSWORD@FLUSSONIC_IP/flussonic/api/dvbts/a0 program=123;
}
Locking device IDs of DVB cards¶
After restarting server OS, device IDs can change. For example, if you capture video from several DVB cards and upgrade your server, you can see that DVB ingest is broken because the IDs of DVB cards in the OS have changed.
To avoid such a situation, lock the IDs of DVB cards by creating a udev
rule.
First, run the following command to see the parameters of each DVB card:
udevadm info -a -n /dev/dvb/adapter0/frontend0
looking at device '/class/dvb/dvb0.frontend0':
KERNEL=="dvb0.frontend0"
SUBSYSTEM=="dvb"
DRIVER==""
looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:02:00.0':
KERNELS=="0000:02:00.0"
SUBSYSTEMS=="pci"
DRIVERS=="b2c2_flexcop_pci"
ATTRS{vendor}=="0x13d0"
ATTRS{device}=="0x2103"
ATTRS{subsystem_vendor}=="0x13d0"
ATTRS{subsystem_device}=="0x2103"
ATTRS{class}=="0x028000"
...
Then, create the file /etc/udev/rules.d/10-local.rules
with the following content (locking by the KERNELS
parameter):
SUBSYSTEM=="dvb", KERNELS=="0000:02:00.0", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter0/%%s $${K#*.}'", NAME="%c", GROUP="video"
SUBSYSTEM=="dvb", KERNELS=="0000:02:02.0", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter1/%%s $${K#*.}'", NAME="%c", GROUP="video"
Ingesting video from TBS Quad ISDB-T¶
To ingest video from a TBS Quad ISDB-T cards, in the Flussonic configuration file add its properties in dvb_card as shown in the example and replace values for adapter number and frequency with your values.
Then specify the stream's source through the mpts-dvb:// scheme.
Example:
dvb_card a0 {
system isdbt;
adapter 5;
frequency 546000000;
}
stream channel5 {
input mpts-dvb://a0?program=1713;
}
Here:
- system — adapter type (isdbt)
- frequency — the carrier frequency (Hz) of the multiplexer
- program — TV channel
Receiving channels¶
As it has been said before, a multiplexer is an MPEG-TS stream. The MPEG-TS transport container allows packing many streams running simultaneously into the same byte stream, providing a standardized method for selecting the desired sub-stream. One TV channel is called a program. An MPEG-TS that contains only one program is called an SPTS, a Single Program Transport Stream. The satellite broadcasts an MPEG-TS that contains a lot of programs; it is called an MPTS — a Multiple Program Transport Stream.
MPTS is convenient for transmitting in the media like satellite or cable, when the band is fixed, and, in order to smooth the traffic, the stream is even supplemented by unnecessary bytes. SPTS is convenient for transmitting over IP, when the client needs a single channel, rather than the entire huge multiplexer.
The process of mixing multiple SPTSs to MPTS is called multiplexing, and is usually performed prior to sending a stream to a satellite or a cable. The process of splitting an MPTS into several SPTSs is called demultiplexing, and occurs during reception from the satellite.
MPTSs are passed via IP very rarely, for example for the purpose of transmitting from the satellite to the cable.
The MPEG-TS itself is a sequence of packets 188 bytes each. The first byte is always 0x47, and it is used for statistically significant synchronization in the stream.
The following three bytes contain an encoded 13-bit number of the stream inside MPEG-TS. This number is called a Pid, and therefore the sub-flow is called a Pid in professional slang.
There are several standard Pid numbers that are reserved for the system needs. Conventionally speaking, these are all numbers up to 32.
The stream with Pid 0 contains information about the programs existing in this MPEG-TS stream. This information is packed into PAT, Program Adaptation Table. A PAT is one of the variants of PSI information. PSI, or PSI tables, stand for the meta-data supplied in the MPEG-TS stream and is only needed for obtaining access to audio/video, or for obtaining additional information, e.g. line-up, or information about channels in other multiplexers.
It is important to understand that all PSI tables were designed for the cases where the receiver receives no data, except from the satellite. Therefore, the majority of PSI tables for IPTV of the OTT service have no meaning: the line-up is often lousy, and information about other multiplexers is generally pointless.
The PAT contains information about which numbers of programs (pnr, program number, service id) are in which pids. These pids will contain PMT (program mapping tables), rather than audio/video streams. PMT will contain information about which pid the stream belongs to, and which pids contain various languages of videos.
During setup, demultiplexing can be adjusted using pids and pnr. The latter is more preferable, since pids on the satellite may be reconfigured without warning, and program numbers usually don't change.
Summing up¶
The process of capturing video from a satellite is as follows:
- the administrator configures (at the headend station or by using special software) the capturing from a correct input, correct frequency and with required polarization
- the stream is demultiplexed from MPTS into several various SPTS, according to settings (most likely using pnr)
- several separate SPTS are streamed into the network via a multicast
In a classic IPTV, this is where it ends, clients receive their multicasts via a cascade of routers communicating over the PIM Protocol, but in our case, it's only the start, since next the resulting video has to be transcoded