Skip to content

DVB S/S2/T/C stream to unicast and multicast demux

Notifications You must be signed in to change notification settings

flohoff/getstream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is getstream

Getstream is a Digitial Video Broadcast (DVB) transport stream demultiplexer. On a satelite transponder you tens if not hundrets of services, be that radio or television programs. To make those services usable for your iTV/IPTV installation these services need to seperated from each other into individual streams. The input is typically a PCIe or USB DVB-S/S2/T/C interface, the output are one or multiple multicast groups or http urls. services can be filtered, pids can be outputtet to pipes for processing for example EPG or Radio RDS/TMC signals

Typical applications are student dorm, hotel or cruise ship IPTV installations.

Getstream is designed to run for months at a time without interruption or user interaction.

Its design trys to avoid memory allocations in the hot path and tries to reduce memory footprint as much as possible to issue packet forwarding in the lowest possible CPU cache.

Building

sudo apt-get install make build-essential libglib2.0-dev libevent-dev pkg-config
make

Execution

getstream -dd -c getstream.conf

Configuration

Adapter:

  As getstream is supposed to support multiple adapters with the same
  program instance the configuration starts with an adapter clause:

	  adapter 1 {
		budget-mode	1;
		packet-buffer	50;
		stat-interval	120;
		stuck-interval  200;
	  };

  - budget-mode
	Set to "0" disabled the budget mode where getstream
	request a seperate PID filter from the kernels filter. As
	the filters are limited on the full featured cards
	this is only a workaround and may work for 2-3 TV
	Channels. Streaming a full transponder on a full featured
	card is most certainly not possible.
	Getstream automatically disables budget mode when setting
	the filter for bit 0x2000 (Illegal value - tells kernel to
	stream full transponder aka "budget-mode") and setting
	the filter returns an error.

  - packet-buffer
	Set the amount of packets getstream trys to get from the
	kernels dvr interface. I see typically ~44 Packets/s per
	round read from the kernel. Setting this too high just
	wastes memory (a packet is 188 Bytes) setting it to low
	creates more context-switches and will reduce performance.

  - dvr-buffer
	Sets the kernel DVR ring buffer size in bytes (should be
	multiple of PAGE_SIZE e.g. 4096 on 32bit x86) via
	DMX_SET_BUFFER_SIZE. 
		
  - stat-interval
  	The interval in seconds you will see the statistics on in the log e.g.

	2007-10-25 08:27:02.323 dvr: inputstats: 149 pids 23259 pkt/s 4372702 byte/s

  - stuck-interval
  	Interval to fire the stuck check timer for e.g. FlexCop cards.
	Default 5 seconds, 0 disables.

Tuning or Card type:

As getstream supports DVB-C, DVB-T and DVB-S and all need different parameters for tuning in on the right transponder here is a short introduction on how to enter the right parameters.

DVB-T:

There are 6 possible options to list for a DVB-T transponder:

  frequency		- Frequency of transponder in Hz
  bandwidth		- auto, 6 (6Mhz), 7 (7Mhz), 8 (8Mhz)
  transmission-mode	- auto, 2 (2Khz), 8 (8Khz)
  guard-interval	- auto, 4 (1/4), 8 (1/8), 16 (1/16), 32 (1/32)
  hierarchy		- none, auto, 1, 2, 4
  modulation	- auto, 16, 32, 64, 128, 256

Example:

    dvb-t {
      frequency 570000000;
      bandwidth 8;
      transmission-mode auto;
      guard-interval auto;
      hierarchy none;
      modulation auto;
    };

DVB-S / DVB-S2:

DVB-S consists of 2 parts - the LNB and the Transponder config:

lnb-sharing	- Boolean When set getstream trys to not send
		  an 22Khz Pilot tone or set high voltage for
		  High/Low band or Polarisation but instead
		  trusts a different card to do all necessary
		  things. Some cards can not disable their power
		  voltage completely so look out for problems.

lnb
	The config needs to match your LNB (Low Block converter)
	on your Dish - If you have a Ku Band LNB (Normal for
	most of the World) you need these informations:

	lof1 	- Local osscilator frequency 1 (Low Band)
	lof2	- Local osscilator frequency 2 (High Band)
	slof	- Local osscilator frequency cut off

	If the transponder frequency is above the slof getstream
	enables the 22Khz Pilot tone to switch the LNB to
	High Band.

	If you have a C Band LNB you dont have a slof so dont
	configure it.  If you have a multipoint C Band LNB
	you have lof1 and lof2 in case you dont just configure
	the lof1.

Transponder:
	frequency	- Frequency of the Transponder in hz.
	polarisation	- Either H or V for Horizontal or Vertical
	symbol-rate	- Symbol Rate - Most European transponders use 27500000
	diseqc		- LNB Diseq code

dvb-s {
	lnb-sharing yes;
	lnb {
		lof1 9750000;
		lof2 10600000;
		slof 11700000;
	};

	transponder {
		frequency 12266000;
		polarisation h;
		symbol-rate 27500000;
		diseqc 4;
	};
};

For "DVB-S2" the type obviously has to be changed to "dvb-s2". Also getstream
need to be compiled against the multiproto header files and you need to be using
multiproto enabled cards.

Input:

The input section in every stream defines which parts of the
Transponder needs to be forwarded into this stream. Currently
there are 3 options.

pid	- A static pid to forward. Sometimes people want to 
	  have the encryption stuff forwarded e.g. pid 10 and 11

pnr	- Program number e.g. a full Programm including all pids.

full	- A full transponder e.g. the same as pid 0x2000.

Example:
--------

input {
	full;
};

output-pipe

Can be used to dump a program or individual pids to a local pipe. This can
be used to parse and process EPG or Radio RDS/TMC data.

Example:
--------

output-pipe {
	filename "/tmp/rdspipe";
};

output-udp/rtp

Used for Multicast output but will accept unicast destinations for example to feed a recoder. May
be either Real Time Protocol (RTP) or plain UDP encapsulation.

local-address	- Local address the udp socket should bind to
remote-address	- Remote address in ipv4 notation.
remote-port	- Remote port to send udp packets to.
ttl		- Time to Live set for UDP packets. Important for multicast

May contain a Service Announcement Protocol (SAP) section - see below.

Example:
--------

	output-udp {
		remote-address 239.0.71.1;
		remote-port 3000;
	};

output-http

Outputs the MPEG Transport Stream at a http url. Needs to have a global http port
number configured.

url	- Url path - FQDN is http://host:port/url

Example:
--------

	output-http {
		url /tv/daserste;
	};

Service announcement protocol (SAP)

Can be used in the output-rtp and output-udp sections to send SAP announcements which for
example vlc can use to  automatically detect programs broadcasted.

scope		- Multicast group which is used for the SAP announcemens.
		  Possible values:
		    global	- Global SAP address (224.2.127.254:9875) (default)
		    org		- Organization-local SAP address (239.195.255.255:9875)
		    local	- Local SAP address (239.255.255.255:9875)
		    link	- Link-local SAP address (224.0.0.255:9875)

sap-group	- Multicast group address which is used for the SAP announcemens (overrides scope).
sap-port	- Port which is used for the SAP announcemens (overrides scope).
announce-host	- unused
announce-port	- unused
ttl		- TTL for the SAP announcemens.
		  By default the output stream's TTL is used.
interval	- Announcement interval (in seconds) (default=1).
playgroup	- SAP/SDP group name.
uri		- An URI with additional information.
description	- Stream description.
email		- EMail contact information (can be used multiple times).
phone		- Phone contact information (can be used multiple times).
attribute	- Additional SDP attribute, see RFC2327 for details (can be used multiple times).

Example:
--------
sap {
	scope global;
	interval 5;
	playgroup "TV";
	description "Example TV stream";
	uri "http://example.com";
	email "<Bob Smith> bob@example.com";
	phone "+49 555 555-555";
	attribute "tool:getstream";
	attribute "recvonly";
};

About

DVB S/S2/T/C stream to unicast and multicast demux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages