dvbstream

From LinuxTVWiki
Jump to navigation Jump to search

dvbstream is a popular utility, from the "DVB tools" project, that can be used to broadcast either a (subset of a) DVB transport stream or a DVB program stream over a LAN using the rtp protocol. It attempts to be compliant with RFCs 1889, 1890, 2038 and 2250.

Note: dvbstream is rather old and is not actively developed. There are newer projects like Mumudvb which are based on dvbstream, and are actively developed.

Features

dvbstream:

  • streams one or more PIDs over network
  • supports network multicast broadcasting (if that is setup with your kernel), so many can recieve the stream, not only one computer in the network.
  • provides a protocol in backwards direction so that the client computer can control the frequency of the DVB card of the server computer and which PIDs get streamed over network
  • can also be used to easily write a stream to harddisk (locally, without network usage - see the Testing your DVB device).

Obtaining the dvbstream package

If the dvbstream package is maintained in a repository available for your "distro", then you can obtain it with your package manager. For example:

  • To install it on a debian system:
# apt-get install dvbstream

Alternatively, dvbstreamp should be easily available for direct download from the Sourceforge project site (see link below).

Note: The default Sourceforge download is for the much older v0.5. For a much more recent version, be sure to download from CVS

Terry Hardie has also made additions to DVBStream, notably:

  • DVB-S2 support
  • Multi LNB type support
  • DiSeqC positioner support
  • Continuity checking (prevents corrupted TS streams being created)
  • Multi file splitting (on size or continuity error)
  • curses interface
  • Multi-threaded high performance file writer (Tested to 80Mbit streams)

You can get this version from here

Usage

Server

After tuning to a transponder, you run dvbstream as follows:

dvbstream pid1 pid2 ... pid8

On the client, use the included dumprtp utility to receive selected PIDs from the multicast:

dumprtp pid1 pid2 > received.ts

Client

To receive the stream on any other machine on your LAN, use the dumprtp utility (included with the dvbstream package, so you'll have to install that also on your client). Easiest usage:

 dumprtp > received.ts

If you have a full-featured DVB card on the client machine, you can use the rtpfeed command to decode the stream; type "rtpfeed -h" for usage information.

Otherwise the same restrictions apply as with a system with a budget DVB card. If you don't have a FF DVB card on the client machine, you can use mpg123 and the mpegtools provided with the DVB driver for live audio decoding:

 dumprtp | ts2es apid | mpg123 -

Alternatively, you can pipe the dumprtp output to your favourite video player, e.g. gxine:

 dumprtp | gxine

It's advisable to cache some data locally if you're in a slow or strongly used network environment, e.g. with mplayer:

 mplayer -cache 2048 rtp://224.0.1.2:5004/

But keep in mind that you'll see the goal only seconds after it happened, so you'll hear the neighbours scream before you see it youself...

PID selection

If you only want audio, you can run dvbstream with eight audio PIDs, and then your clients can choose which PID to play. Dvbstream supports up to 8 PIDs, and audio streams have much lower bandwidth so you can stream many of them.

Telnet Interface

From v0.4 onwards, DVBstream incorporates a "telnet" interface to allow you to remotely start and stop the streaming, and tune the card to a different channel.

The following commands are supported:

  • TUNE freq pol srate
  • STOP
  • ADDV pid[:map]
  • ADDA pid[:map]
  • ADDT pid[:map]
  • ADD pid[:map]
  • QUIT

STOP closes down all PIDs and stops the streaming. The other commands should be self-explanatory. See the scripts in the TELNET directory for example usage. The default port is 12345

Note: Some of the text above has been taken directly from the readme written by Alastair McKinstry (linked to below), which stands under a GNU license ... (the tiny amounts should be fair use anyway)

External Links