Create DVB Channel Playlist

*nix specific usage questions
h0me5k1n
New Cone
New Cone
Posts: 1
Joined: 29 Jan 2008 01:14

Create DVB Channel Playlist

Postby h0me5k1n » 29 Jan 2008 01:58

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.

vel_tins
Blank Cone
Blank Cone
Posts: 81
Joined: 22 Nov 2007 08:51

Re: Create DVB Channel Playlist

Postby vel_tins » 10 Feb 2009 17:26

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

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Create DVB Channel Playlist

Postby Rémi Denis-Courmont » 10 Feb 2009 17:54

Syntax is dvb://adapter=1,frequency=...,... and so on. Don't use EXTVLCOPT (or don't whine if it breaks).
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

vel_tins
Blank Cone
Blank Cone
Posts: 81
Joined: 22 Nov 2007 08:51

Re: Create DVB Channel Playlist

Postby vel_tins » 10 Feb 2009 18:14

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..

Chris123
Blank Cone
Blank Cone
Posts: 19
Joined: 13 Jun 2007 13:40
VLC version: 0.9.9a
Operating System: Ubunutu 0.04

Re: Create DVB Channel Playlist

Postby Chris123 » 01 Jul 2009 11:07

Hello

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

infonux
New Cone
New Cone
Posts: 1
Joined: 04 Aug 2010 13:32

Re: Create DVB Channel Playlist

Postby infonux » 04 Aug 2010 13:35

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.


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 37 guests