Go Back   Winamp Forums > SHOUTcast > SHOUTcast Technical Support

Reply
Thread Tools Search this Thread Display Modes
Old 7th March 2005, 22:28   #1
jcampos
Junior Member
 
Join Date: Feb 2005
Location: Lisbon
Posts: 20
Sc_trans

Hello, as i know, the sc_trans make a re-encoding of files that we put in the playlist.
Some people told me that it use too cpu to make the work.

My question is, if i put all mp3 in same bitrate and dont want sc_trans to reencode de mp3 files, can i use it only to read files and broadcast ?

Thanks in advance,
João Campos
jcampos is offline   Reply With Quote
Old 8th March 2005, 16:05   #2
DJ AmPs
Major Dude
 
DJ AmPs's Avatar
 
Join Date: Mar 2002
Location: g
Posts: 1,603
Not possible with sc_trans. You need something more basic, like duh-cast

http://www.smackfu.com/stuff/programming/duhcast.html
DJ AmPs is offline   Reply With Quote
Old 9th March 2005, 10:49   #3
jcampos
Junior Member
 
Join Date: Feb 2005
Location: Lisbon
Posts: 20
Ive installed that and it runs like I wanted, but the perl script goes down when the playlist ends, it says that the connection with the servers brokes down.

Theres something to do?

Thanks again,
João Campos

Last edited by jcampos; 9th March 2005 at 11:14.
jcampos is offline   Reply With Quote
Old 9th March 2005, 12:44   #4
DJ AmPs
Major Dude
 
DJ AmPs's Avatar
 
Join Date: Mar 2002
Location: g
Posts: 1,603
Try emailing the author. I do not use this script.
DJ AmPs is offline   Reply With Quote
Old 9th March 2005, 13:01   #5
bored_womble
Winamp's Womble
 
bored_womble's Avatar
 
Join Date: May 2004
Location: Wimbledon Common
Posts: 1,088
Try this, and I do not use it either, but it *may* work, if it does not ... no idea

Where the script has the following

} continue {
$conn->sleep;
}
close(MP3FILE);
}

}

Change it to

} continue {
$conn->sleep;
}
close(MP3FILE);
}
$conn->disconnect();
}

Without open minds the world will die. Open yours and correct the mistakes you are making right now.
bored_womble is offline   Reply With Quote
Old 9th March 2005, 16:35   #6
jcampos
Junior Member
 
Join Date: Feb 2005
Location: Lisbon
Posts: 20
Many thanks to your fast answer.
Can you tell me what method you use to play a on-disk system streaming.

Anyways im currently testing your script enchangement but i need to know if exist a better way to do this.
I really need some help on it.

Best Regards,
João Campos
jcampos is offline   Reply With Quote
Old 9th March 2005, 17:04   #7
bored_womble
Winamp's Womble
 
bored_womble's Avatar
 
Join Date: May 2004
Location: Wimbledon Common
Posts: 1,088
looking at the script it will do the job. I have written something similar, but alot more features to provide an on disk streamer, and it is not in any shape to be given out to the general masses.

to be fair ... sc_trans is a godd little utility, some nice features and should do ... the same thing as that script..

BW

Without open minds the world will die. Open yours and correct the mistakes you are making right now.
bored_womble is offline   Reply With Quote
Old 9th March 2005, 20:16   #8
jcampos
Junior Member
 
Join Date: Feb 2005
Location: Lisbon
Posts: 20
As i know the sc_trans use a lot of cpu causa it does a realtime encoding.

I just want something that read the playlist and when finished the last song, it goes to the first one, as a winamp repeat function.

I really need something, even if you want to show me what you have written.

Best Regards,
João Campos
jcampos is offline   Reply With Quote
Old 10th March 2005, 12:27   #9
bored_womble
Winamp's Womble
 
bored_womble's Avatar
 
Join Date: May 2004
Location: Wimbledon Common
Posts: 1,088
Download

http://downloads.xiph.org/releases/l...out-2.1.tar.gz
http://downloads.xiph.org/releases/l...out-2.1.tar.gz

You may also need other libs, depending on what you have installed.
If the follow configure,make complain about things which are missing
I can not help you, as they are OS dependent, and I have gone well
beyond the normal support on here.

Disclaimer. If this script breaks your system, I can not be held responsible.
Run it at your own risk to you and your systems.

Do the following

tar zxvfm libshout-2.1.tar.gz
cd libshout-2.1/
./configure
make
su
make install
exit

tar zxvfm Shout-2.1.tar.gz
cd Shout-2.1/
perl Makefile.PL
make
su
make install
exit

Create directory for your files
create a plain text file each line representing a filename save the
file called 'playlist'

Save the code below as another file called 'player.pl'
Changing the IP and Port and Password in the script to match
that of your Shoutcast server.

The sleeps are in there, to stop the script from continously looking
for playlists and attempting to reconnect as fast as it can. There is
a much nicer way of doing it, however that is not the purpose of this
script.

in the same directory as your playlist and MP3s, then do

perl player.pl playlist


#!/usr/bin/perl

use strict;
use bytes;
use Shout qw (:all);
use IO;

my $playlist = @ARGV[0];
my $filename;

unless ( @ARGV==1 )
{ my ($name)=($0 =~ /([^\/]+$)/); print "Usage: $name <playlist>\n"; exit(0); }

my $streamer=new Shout;

# Kinda leave these bits alone.
$streamer->format ( SHOUT_FORMAT_MP3 );
$streamer->protocol(SHOUT_PROTOCOL_HTTP);

# Set up the name of your station and genre

$streamer->name("Bored_Womble Productions");
$streamer->genre("Womble Music");

# Set the flag for public, private. 1 is public
# 0 is private. Leave is 0 until it all works.
$streamer->ispublic(0);
$streamer->bitrate(96);
$streamer->url("http://www.wombles.co.uk");

# The IRC, ICQ and AIM do not work in the standard release

# version of libshout and Shout packages, so I have removed
# by commenting them out here.

#$streamer->irc("IRC Setting");
#$streamer->icq("ICQ Setting");
#$streamer->aim("AIM Setting");

$streamer->ip("192.168.1.1");
$streamer->port(8000);
$streamer->icy_compat(1);
$streamer->password("wombles");

while (1)
{
if ($streamer->connect)
{
while (1) {
if ( open (FILELIST,"<$playlist")) {
while (<FILELIST>) {
chop(); $filename=$_;
# We remove any leading .. just in case
$filename=~s/\.\.//ig;
# We remove any leading / just in case
$filename=~s/\///ig;
&streamit($filename,$streamer );
}
close (FILELIST);
}
else { print "Playlist file not found, specified was '$playlist'\n"; }
sleep(1);
}
}
else { print "Connection error was '".$streamer->get_error."'\n"; }
sleep(1);
}

exit(0);

sub streamit {
my ($filename,$Stream_Object) = @_;
my ($buff, $len );
if ( open(SONG, "<$filename") )
{
$filename=~s/\.mp3//ig;
$Stream_Object->set_metadata("song" => $filename );
while (($len = sysread(SONG, $buff, 4096)) > 0) {
$Stream_Object->send( $buff ) && next;
if ( $Stream_Object->get_error=~/socket/ig)
{ close (SONG);
print STDERR "Error while sending: ", $Stream_Object->get_error, "\n";
return 1; }
last;
}
continue
{ $Stream_Object->sync }
}
$Stream_Object->sleep;
close(SONG);
return 1;
}

Without open minds the world will die. Open yours and correct the mistakes you are making right now.
bored_womble is offline   Reply With Quote
Old 10th March 2005, 19:17   #10
jcampos
Junior Member
 
Join Date: Feb 2005
Location: Lisbon
Posts: 20
Hello, it is a great script.
Just two issues...
1) The first music is the only repeated. I want it to plays all playlist, and when it plays the last song it comes to first one again.

2) Sometimes your scripts disconnetcs from localhost server.

I dont know if i do someting wrong but i think its all ok with the steps that ive done.

Regards,
Joao Campos
jcampos is offline   Reply With Quote
Old 10th March 2005, 19:31   #11
jcampos
Junior Member
 
Join Date: Feb 2005
Location: Lisbon
Posts: 20
HIIIII sorry it runs like i want mate.
You saved me, too many thanks

I want to donate to you eeheheh

REGARDFULL thanks to you.

Joao Campos
jcampos is offline   Reply With Quote
Old 10th March 2005, 22:00   #12
bored_womble
Winamp's Womble
 
bored_womble's Avatar
 
Join Date: May 2004
Location: Wimbledon Common
Posts: 1,088
glad it works ... and hopefully a few pointers to others too ..

BW

Without open minds the world will die. Open yours and correct the mistakes you are making right now.
bored_womble is offline   Reply With Quote
Old 10th March 2005, 22:21   #13
jcampos
Junior Member
 
Join Date: Feb 2005
Location: Lisbon
Posts: 20
Too many thanks.

Just to know if it is possible...
Imagine... A radio where we have a 10 comercials/jingles and 100 musics; theres is anyway to generate a playlist where the 100 musics are randoomly generated in playlist everyday.. but the 10 comercials/jingles are always in same place in playlist.

Example:
song 1 (randoomly generated)
song 2 (randoomly generated)
comercial/jingle (Static position)
song 3 (randoomly generated)
song 4 (randoomly generated)
comercial/jingle (Static position)


Thanks in advance,
Best Regards
Joao Campos
jcampos is offline   Reply With Quote
Old 10th March 2005, 22:34   #14
bored_womble
Winamp's Womble
 
bored_womble's Avatar
 
Join Date: May 2004
Location: Wimbledon Common
Posts: 1,088
that is quite possible.

You could create a script to create the playlist, then feed it into the play script provided, or do them at the same time.

It is not a small piece of work, as if you want fixed slots, you need to maintain a list, not to be used, and also check you have filled all the others before exiting.

I'll have a ponder over it, but I may not get round to it for a while, as between my day job and running some streams not alot of time.

BW

Without open minds the world will die. Open yours and correct the mistakes you are making right now.
bored_womble is offline   Reply With Quote
Old 26th March 2005, 08:22   #15
deamen
Junior Member
 
Join Date: Mar 2005
Posts: 2
Hi There,
Thank you very much for your good explanation. This helpded me find the correct to tools, to achieve my goals

I only have a problem running the perl script. I receive this error message, while I compiled and installed the packages, which are described in this thread.

content]# perl player.pl test.pls
Can't load '/usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi/auto/Shout/Shout.so' for module Shout: libshout.so.3: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.3/i386-linux-thread-multi/DynaLoader.pm line 229.
at player.pl line 5
Compilation failed in require at player.pl line 5.
BEGIN failed--compilation aborted at player.pl line 5.


Does anyone know the cause of this?
deamen is offline   Reply With Quote
Old 26th March 2005, 11:15   #16
bored_womble
Winamp's Womble
 
bored_womble's Avatar
 
Join Date: May 2004
Location: Wimbledon Common
Posts: 1,088
it just means there are other packages you need to install.

The code was written with perl 5.8.4 as a base, and some development libraries and modules installed. Have a search on

www.cpan.org

for dynaloader and see if you can find the required package.

BW

Without open minds the world will die. Open yours and correct the mistakes you are making right now.
bored_womble is offline   Reply With Quote
Reply
Go Back   Winamp Forums > SHOUTcast > SHOUTcast Technical Support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump