Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TunezIces2/Icecast2 compatible script perl and conf.xml

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Source Clients
View previous topic :: View next topic  
Author Message
Raclo94



Joined: 24 Apr 2007
Posts: 4

PostPosted: Tue Apr 24, 2007 2:31 pm    Post subject: TunezIces2/Icecast2 compatible script perl and conf.xml Reply with quote

<?xml version="1.0"?>
<ices>
<!-- run in background -->
<background>1</background>
<!-- where logs, etc go. -->
<logpath>/var/log/ices</logpath>
<logfile>ices.log</logfile>
<!-- 1=error,2=warn,3=info,4=debug -->
<loglevel>4</loglevel>
<!-- set this to 1 to log to the console instead of to the file above -->
<consolelog>0</consolelog>

<!-- optional filename to write process id to -->
<pidfile>/var/ices/ices.pid</pidfile> -->

<stream>
<!-- metadata used for stream listing (not currently used) -->
<metadata>
<name>name of your stream</name>
<genre>genre</genre>
<description>description your stream</description>
<url>url</url>
</metadata>

<!-- input module

The module used here is the playlist module - it has
'submodules' for different types of playlist. There are
two currently implemented, 'basic', which is a simple
file-based playlist, and 'script' which invokes a command
to returns a filename to start playing. -->

<input>
<param name="type">script</param>
<param name="program">/etc/./ices2.pl</param>
</input>

<!-- Stream instance
You may have one or more instances here. This allows you to
send the same input data to one or more servers (or to different
mountpoints on the same server). Each of them can have different
parameters. This is primarily useful for a) relaying to multiple
independent servers, and b) encoding/reencoding to multiple
bitrates.
If one instance fails (for example, the associated server goes
down, etc), the others will continue to function correctly.
This example defines two instances as two mountpoints on the
same server. -->
<instance>
<!-- Server details:
You define hostname and port for the server here, along with
the source password and mountpoint. -->
<hostname>hostname your server icecast</hostname>
<port>8000</port>
<password>password icecast</password>
<mount>/play.ogg</mount>
<yp>1</yp>

<!-- Reconnect parameters:
When something goes wrong (e.g. the server crashes, or the
network drops) and ices disconnects from the server, these
control how often it tries to reconnect, and how many times
it tries to reconnect. Delay is in seconds.
If you set reconnectattempts to -1, it will continue
indefinately. Suggest setting reconnectdelay to a large value
if you do this.
-->
<reconnectdelay>2</reconnectdelay>
<reconnectattempts>5</reconnectattempts>

<!-- maxqueuelength:
This describes how long the internal data queues may be. This
basically lets you control how much data gets buffered before
ices decides it can't send to the server fast enough, and
either shuts down or flushes the queue (dropping the data)
and continues.
For advanced users only.
-->
<maxqueuelength>80</maxqueuelength>

<!-- Live encoding/reencoding:
Currrently, the parameters given here for encoding MUST
match the input data for channels and sample rate. That
restriction will be relaxed in the future.
-->
<encode>
<nominal-bitrate>48000</nominal-bitrate> <!-- bps. e.g. 64000 for 64 kbps -->
<samplerate>44100</samplerate>
<channels>2</channels>
</encode>
</instance>

</stream>
</ices>

c/c this and name tunez.xml and copy /etc/


#!/usr/bin/perl
#
# Tunez (http://tunez.sourceforge.net) Ices2/Icecast2 compatible script
#
# This script is based on the ices.pm script distributed with tunez-1.20.
# It returns the filename of the song to play.
#

use DBI;
use PQueue;

# Mysql information (should be identical to config.inc.php)
my $mysql_dbhost = "localhost";
my $mysql_dbuser = "tunez";
my $mysql_dbpass = "password";
my $mysql_dbname = "tunez";

# connect to database
my $queue = PQueue->new(
username => $mysql_dbuser,
password => $mysql_dbpass,
hostname => $mysql_dbhost,
database => $mysql_dbname,
);

$queue->connect();
$queue->generate_from_votes();

# query the database
$queue->read();
my %var = $queue->dequeue();

# output filename to stdout
print $var{'filename'};

exit;

c/c this and name ices2.pl and copy /etc/

you have right A to modify the two files with your data personnel,
password etc...

to start would be modified your script of starting ices to
indicate /etc/tunez.xml to it

or to open a console in root ;
cd /etc
/folder are your ices/ices /etc/tunez.xml
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Source Clients All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber