RecordStream


Using mplayer to record streams from a dvb device.

--------------------------------------------
Record 1 single channel
--------------------------------------------
I do this with mplayer in a simple loop (to recover
from errors on the received stream)

echo << EOF > record.sh
#!/bin/sh

while /bin/true
do
fn=`date +%y%m%d%H%M%S`
mplayer -dumpstream -dumpfile ${fn}.stream dvb://mychan
sleep 1
done
EOF

Then I can play the stream with:
mplayer 100221191000.stream

--------------------------------------------
Record more channels at time
--------------------------------------------
To do this you need to the following programs:
tzap (package dvb-apps)
dvbstream (package dvbstream)
mplayer (package mplayer)

Record more channels at the same time
is possible if the channel to be recorded are on the
same frequency. You can check this by looking at the
channels.conf file, usually located in your home, on:
.mplayer/channels.conf file.

First of all we need to select the frequency we are
interested on (let's suppose 666000000) and put a zero
for audio and video pids.

The create a channels file:
echo "multichan:666000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_2_3:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_32:HIERARCHY_NONE:0:0:0" > /tmp/channels

Then use tzap with our fake channel, multichan:
tzap -c /tmp/channels -r multichan

I do not know if it is mandatory to select the frequency with
tzap, since is possible to specify the frequency on the dvbstream,
but dvbstream (at least on my system, will not work, and produce
an empty file).

What I want is to record two channels, so select the audio and video pids
from the channels.conf file (the third and the second from last of the line)
and launch dvbstream:

dvbstream 513 651 523 604 -o > /tmp/multistream

Then use mplayer to play the file:

mplayer /tmp/multistream

and change video/audio pids with underscore, hash, or TAB.

(105 minutes, two channels with audio and video pid
are ~4G of data stream)
--------------------------------------------
Boradcast over the network
--------------------------------------------
To broadcast the stream over the network:

dvbstream 513 651 523 604 # the magic 8192 pid means all pids

and on the client:

mplayer rtp://224.0.1.2:5004