|
|
#1 |
|
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 |
|
|
|
|
|
#2 |
|
Major Dude
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 BB 192k Mp3 HIGH DEFINITION | BB 24k Mp3 | BB 20k WMA | BB Community __________________________ My Host - Fast-Serv.com | Free Shoutcast Hosting - Coming Soon... |
|
|
|
|
|
#3 |
|
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. |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Mar 2002
Location: g
Posts: 1,603
|
Try emailing the author. I do not use this script.
BB 192k Mp3 HIGH DEFINITION | BB 24k Mp3 | BB 20k WMA | BB Community __________________________ My Host - Fast-Serv.com | Free Shoutcast Hosting - Coming Soon... |
|
|
|
|
|
#5 |
|
Winamp's Womble
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. |
|
|
|
|
|
#6 |
|
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 |
|
|
|
|
|
#7 |
|
Winamp's Womble
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. |
|
|
|
|
|
#8 |
|
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 |
|
|
|
|
|
#9 |
|
Winamp's Womble
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. |
|
|
|
|
|
#10 |
|
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 |
|
|
|
|
|
#11 |
|
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 |
|
|
|
|
|
#12 |
|
Winamp's Womble
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. |
|
|
|
|
|
#13 |
|
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 |
|
|
|
|
|
#14 |
|
Winamp's Womble
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. |
|
|
|
|
|
#15 |
|
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? |
|
|
|
|
|
#16 |
|
Winamp's Womble
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. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|