Page 1 of 1

Create DVB Channel Playlist

Posted: 29 Jan 2008 01:58
by h0me5k1n
I've created 2 bash scripts that will parse the "channel list" downloaded by the dvbutils "scan" utility and create a playlist for vlc. I wanted to be able to update my channel lists for my DVB-T and DVB-S cards and create playlists for vlc easily.

TO SCAN FOR THE CHANNELS FOR YOUR DVB CARD:
(You can find the instructions for this in many places - I've just included them for completeness)
see the LinuxTV Wiki for details of dvbutils.

install dvbutils (debian):
sudo apt-get install dvb-utils

DVB-T channel scan:
scan -x 0 /usr/share/doc/dvb-utils/examples/scan/dvb-t/uk-Oxford > ~/dvbtchannels.conf
(I use "uk-Oxford" as it's my local terrestrial TV transmitter. IIRC the "-x 0" scans for free channels only)

DVB-S channel scan:
scan -x 0 /usr/share/doc/dvb-utils/examples/scan/dvb-s/Astra-28.2E > ~/dvbschannels.conf
(I use "Astra-28.2E" as this is the satellite my dish is pointed at)

If you have more than one card you'll need to set the adaptor number (with a "-a" argument) to scan with the second card, for example:
scan -a 1 -x 0 /usr/share/doc/dvb-utils/examples/scan/dvb-s/Astra-28.2E > ~/dvbschannels.conf

CREATING THE PLAYLISTS

once you have dvbtchannels.conf and/or dvbschannels.conf use the bash scripts below to create playlists:

DVBT

Code: Select all

#!/bin/bash PLAYLIST=~/DVB-T_playlist.m3u SOURCEFILE=~/dvbtchannels.conf # Place header in playlist file echo "#EXTM3U" > $PLAYLIST # Read the dvbutils channel file echo "please wait whilst $SOURCEFILE is parsed" cat $SOURCEFILE | while read LINE # Parse the channel name, frequency, symbol rate and service ID do CHANNELNAME=$(echo "$LINE" | sed 's/\:.*$//') CHANNELFREQ=$(echo $LINE | sed 's/\:/+/1' | sed 's/.*+//' | sed 's/\:.*//') CHANNELSERVICEID=$(echo "$LINE" | sed 's/^.*\://') # echo the channel information into the correctly formatted playlist echo "#EXTINF:0,$CHANNELNAME" >> $PLAYLIST echo "#EXTVLCOPT:dvb-adapter=1" >> $PLAYLIST echo "#EXTVLCOPT:dvb-frequency=$CHANNELFREQ" >> $PLAYLIST echo "#EXTVLCOPT:program=$CHANNELSERVICEID" >> $PLAYLIST echo "#EXTVLCOPT:dvb-bandwidth=8" >> $PLAYLIST echo "dvb://" >> $PLAYLIST done echo "$PLAYLIST created" echo "to play type:" echo "vlc $PLAYLIST"
DVBS

Code: Select all

#!/bin/bash PLAYLIST=~/DVB-S_playlist.m3u SOURCEFILE=~/dvbschannels.conf # Place header in playlist file echo "#EXTM3U" > $PLAYLIST # Read the dvbutils channel file echo "please wait whilst $SOURCEFILE is parsed" cat $SOURCEFILE | while read LINE # Parse the channel name, frequency, symbol rate and service ID do CHANNELNAME=$(echo "$LINE" | sed 's/\:.*$//') CHANNELFREQ=$(echo $LINE | sed 's/\:/+/1' | sed 's/.*+//' | sed 's/\:.*//' | sed 's/$/000/') CHANNELSYMBRATE=$(echo $LINE | sed 's/\:/+/4' | sed 's/.*+//' | sed 's/\:.*//' | sed 's/$/000/') CHANNELSERVICEID=$(echo "$LINE" | sed 's/^.*\://') # echo the channel information into the correctly formatted playlist echo "#EXTINF:0,$CHANNELNAME" >> $PLAYLIST echo "#EXTVLCOPT:dvb-adapter=0" >> $PLAYLIST echo "#EXTVLCOPT:dvb-frequency=$CHANNELFREQ" >> $PLAYLIST echo "#EXTVLCOPT:dvb-srate=$CHANNELSYMBRATE" >> $PLAYLIST echo "#EXTVLCOPT:program=$CHANNELSERVICEID" >> $PLAYLIST echo "dvb://" >> $PLAYLIST done echo "$PLAYLIST created" echo "to play type:" echo "vlc $PLAYLIST"
Any comments are welcome.

Re: Create DVB Channel Playlist

Posted: 10 Feb 2009 17:26
by vel_tins
Hello,
yes I know this thread is a little bit old... :)
Thanks, these scripts work good for me, but for the DVB-S script I miss the option to parse the v/h (13V/18V) line.
Can everybody post the "sed" command for these values, so I can integrate it into the script.?

thanks in advance

Re: Create DVB Channel Playlist

Posted: 10 Feb 2009 17:54
by RĂ©mi Denis-Courmont
Syntax is dvb://adapter=1,frequency=...,... and so on. Don't use EXTVLCOPT (or don't whine if it breaks).

Re: Create DVB Channel Playlist

Posted: 10 Feb 2009 18:14
by vel_tins
yes, I know the syntax, and I also know, that the 0.9x VLC cannot be used with the "EXTVLCOPT" command to stream DVB.
(has been ignored....unsafe options)
But I changed the above script a little bit, to generate a VLM.conf file.
But I dont know the sed syntax, to include the v/h value into the script..

Re: Create DVB Channel Playlist

Posted: 01 Jul 2009 11:07
by Chris123
Hello

do u got a solution for this?. Please let us know. Perhaps u can show your script for VML.

Re: Create DVB Channel Playlist

Posted: 04 Aug 2010 13:35
by infonux
Hi,
The solution is here: http://code.google.com/p/freetuxtv/
The DVB is work now! : http://code.google.com/p/freetuxtv/wiki/Contribuez

Thanks.