Koozali.org: home of the SME Server

Old Topic - Need Better Solution "Streaming Audio to a web site"

Offline cbacani

  • *
  • 111
  • +0/-0
Old Topic - Need Better Solution "Streaming Audio to a web site"
« on: September 13, 2007, 02:21:33 AM »
All,

Icecast or shoutcast just don't do it. Some friends of mine in Canada are looking for a way to use a MP3 player on a Windows computer to send a audio stream to a website. They want to be able to have the visitor click on a link named 'listen live' and get the broadcast.

There are services that do this for a fee and some of that is outlawed in Canada using FM radio but the internet seems to still be open to the suggestion of streaming audio.

Any ideas? Anybody setup some software on a SME Server? I am willing to try just about anything that even looks like it might work.

Thanks in advance
Carl

Offline imcintyre

  • *
  • 609
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #1 on: September 13, 2007, 03:49:31 AM »
Sorry can't help with problem but interested in the "outlaw in Canada" comment. Would you please post a link to a document clarifying. TIA, sorry for "hijack"

Offline cbacani

  • *
  • 111
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #2 on: September 13, 2007, 06:11:30 AM »
http://zone.ni.com/devzone/cda/tut/p/id/3121
http://strategis.ic.gc.ca/epic/site/smt-gst.nsf/en/h_sf00000e.html

This is a lot of stuff to read - kind of like working your way through Part 15 of the FCC.

I was talking about having a transmitter with 100 watts on the FM dial and also sending the feed over the internet on to a web page where people could listen. A low wattage license is required here for that amount of wattage in the US but in Canada ( Canadian Department of Communications ) it is a little different. A friend of mine in Canada says he has NOT been notified of any violation but his friend was questioned about it from the people that want you to pay a license fee for broadcasting. The official was quoted as stating ' We send out a person that will perform a survey in your area and if you meet the criteria, we will send you a license request along with a bill' and that was enough for him to stop.

Remember this applies to broadcasing on the FM dial - streaming on the internet is another matter.

Too many people get involved and suck the fun out of everything that you want to do. I think my father called them 'spoilers' and he was pretty much right.

Carl

Offline imcintyre

  • *
  • 609
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #3 on: September 13, 2007, 09:26:42 AM »
Thx - our tax dollars at work (well mine anyway).

Offline cbacani

  • *
  • 111
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #4 on: September 13, 2007, 11:10:09 PM »
Anybody else have any solution? All I need is someway to stream a mp3 to a website. I can't think of any other software to use that would send it to where I need it and not over the entire web. OK guys and gals any ideas?

Carl

Offline Reinhold

  • *
  • 517
  • +0/-0
    • http://127.0.0.1
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #5 on: September 14, 2007, 06:22:57 PM »

Hi carl,

From your description this will not quite fit your bill labeled "live stream"
and for SME your listeners will need RealAudio Player (or mplayer (plugin) in Linux)
...but here is "some widely unknown" "secret streaming recipe" 8) :D :cool:

- POOR MANS AUDIO STREAMING RECIPE -
you need 3 files:
stream.mp3  <- your mp3 audio
stream.ram  <- starts streaming
index.html  <- the webpage

- store your mp3 on your webspace i.e.  "http://www.mydomain.org/stream.mp3"

- use a texteditor to generate a file that only contains the single line
Code: [Select]
http://www.mydomain.org/stream.mp3- store this textfile on your webspace as "http://www.mydomain.org/stream.ram"

- with your favourite editor generate the webpage containing:
Code: [Select]
<html><a href="http://www.mydomain.org/stream.ram">live stream</a></html>- store that file as "http://www.mydomain.org/index.html"

 :o
- use your favourite browser to surf to "http://www.mydomain.org/"
- use your mouse, klick "live stream"
- voila your streaming server


Enjoy
Regards
Reinhold
............

Offline cbacani

  • *
  • 111
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #6 on: September 14, 2007, 07:47:40 PM »
Thank all of you for your suggestions. Here is what I ended up with.

Our radio station running at 99.3 FM and so far so good. The other idea was to have the station broadcast on the web page so when you pressed the 'listen now button' you could hear what was being broadcast on the FM locally.

The issue was what program to use and how to contain it.

Shoutcast Server on SME version 7.2 with current updates as of September 14th 2007.

Installing Shoutcast on the SME server as follows.

mkdir -p /opt/shoutcast

cd /opt/shoutcast

wget http://www.shoutcast.com/downloads/sc1-9-8/sc_serv_1.9.8_Linux.tar.gz
tar -zxvf sc_serv_1.9.8_Linux.tar.gz

mkdir -p /var/service/shoutcast
mkdir -p /var/service/shoutcast/log

cd /var/service/shoutcast

pico -w run  (SEE NOTE #1)

cd log

pico -w run   (SEE NOTE #2)

touch /var/service/shoutcast/down

mkdir -p /var/log/shoutcast

config set shoutcast service access public status enabled TCPPorts 8000:8001

ln -s /var/service/shoutcast /service/shoutcast
ln -s /etc/rc.d/init.d/daemontools /etc/rc.d/init.d/supervise/shoutcast
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc7.d/S92shoutcast

chmod 755 /var/service/shoutcast/run
chmod 755 /var/service/shoutcast/log/run
chown smelog:smelog /var/log/shoutcast

/sbin/e-smith/signal-event console-save
/sbin/e-smith/signal-event post-upgrade
/sbin/e-smith/signal-event reboot

ln -s /etc/rc.d/init.d/shoutcast S92shoutcast

pico sc_serv.conf to set password and other options.


NOTE #1 Place the 3 lines of code below into run #1
-------------------------------------

#!/bin/sh
 exec 2>&1
 exec /opt/shoutcast/sc_serv /opt/shoutcast/sc_serv.conf




NOTE #2 Place the 5 lines of code below into run #2
-------------------------------------
#!/bin/sh
exec                                    \
    /usr/local/bin/setuidgid smelog     \
    /usr/local/bin/multilog t s5000000  \
    /var/log/shoutcast

----------------------------------------------------------------
On Your Webpage

On your webpage add something like this <p>&nbsp;<a href="http://your ip address:8000/listen.pls" title="Listen Live"><br />LISTEN LIVE</a></p>

------------------------------------------------------------------

We are feeding the server using Winamp v5.35 (x86) - May 14 2007 with the DSP v 1.9.0.

-------------------------------------------------------------------

Server configuration file options.
If you wish to configure the SHOUTcast server, the configuration file contains several options that can be changed. here is a basic explanation of what each option does.

PortBase:    The port SHOUTcast should send use for sending audio. The default is 8000. Unix users should be aware that they cannot use a port below 1024 unless they run the server as root.

MaxUser:    The maximum allowable listeners at any one time. Make sure you set this to a realistic number depending on your bandwidth and operating system. Maximum bandwidth used for serving is equal to the bitrate you are serving at multiplied by MaxUser x 1.1.

Password:    The password to use for streaming content and administration. This needs to precisely match the password in the shoutcast dsp plug-in in order for source providers to send content with your server.

Logfile:    The file to use to store the console log. Use /dev/null or leave empty to disable file-based logging.

SrcIP:    The IP interface to bind the source listener to. Only important on machines with more than one IP interface or ethernet card. Default is to listen to all ip addresses, when set to ANY.

DestIP:    The IP interface to listen for clients on. Only important on machines with more than one IP interface or ethernet card. Default is to listen to all ip addresses, when set to ANY.

RelayServer:    [Optional] If defined, the SHOUTcast server will not accept source connections, and instead attempt to connect to the server name defined here for transmission

RelayPort:    [Optional] The port that the relay server is sending audio on.

RelayPublic:    [Optional] When running a relay server, use "always" to make the server always public (regardless of whether the source server is public) or "never" to make the server never public. Anything else makes the server the same as the source server.

RealTime:    [Console systems only] This flag determines whether or not the server displays a real-time status indicator with listner count.

ScreenLog:    [Console systems only] If this flag is set to 1, the server will display all diagnostic data on screen in addition to writing it to the logfile.

HistoryLog:    [Optional] If set to anything other than 'none', the server will append to the file named here information on listener count, timestamp, and metadata at a provided interval.

HistoryLogTime:    [Optional] The value, in seconds, of how often the server should update the HistoryLogFile.

Yport:    [Optional] If you're located behind a web cache, you can tell the Shoutcast server to use a different inbound port to send directory data to. The only values that work are 80 and 800. The default is 80.

NameLookups:    [Optional] If set to 1, the server will attempt to resolve all IP addresses into their FQDN (i.e. 207.48.52.225 becomes www.winamp.com)

AutoDumpUsers:    [Optional] If set to 1, the server will disconnect listeners whenever the source becomes inactive. Otherwise, listeners are left connected and either get dead air or the BackupFile (see below).

IntroFile:    [Optional] If defined, the server will send this file as-is to the listener before joining them with the content stream. CAUTION: This file MUST be in MP3 format, and of the *PRECISE* same bitrate, samplerate, and mono/stereo setting as your stream!!! If the file differs from the stream, the user gets an earful of nastiness or dead air.

BackupFile:    [Optional] If defined, the server will send this file as-is to the listener whenever the server loses contact with the source stream or the source stream idles for 30s or more. CAUTION: This file MUST be in MP3 format, and of the *PRECISE* same bitrate, samplerate, and mono/stereo setting as your stream!!! If the file differs from the stream, the user gets an earful of nastiness or dead air.

TitleFormat:    [Optional] When defined, this string will repurpose how metadata appears to the player. If the flag %s is included in the parameter, then the title data from the source is included at that point in the string. For example, if your TitleFormat is 'Justin Radio: %s', and the source plug-in's title is 'Billy plays the blues', then the net title is 'Justin Radio: Billy plays the blues'. Note: only works on non-relay servers. The default is no format string.

URLFormat:    [Optional] This behaves just like TitleFormat, except it applies to the minibrowser URL. Only useful when you want to do redirections and keep track of 'em.

CurrentLog:    [Optional] CurrentLog provides a mechanism for regular updates to a file located on the same server as the SHOUTcast server. CurrentLog itself as a parameter does not exist, but rather is a family of parameters. They are as follows:

    CurrentLogIn is the filename of an HTML template file.

    CurrentLogOut is the filename the server should output the file to.

    CurrentLogTime is the number of seconds the server should wait between updates to the output file.

That's about it. It just works. Special thanks to William for his help on this project.

Carl

Offline Reinhold

  • *
  • 517
  • +0/-0
    • http://127.0.0.1
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #7 on: September 14, 2007, 10:42:19 PM »
Icecast or shoutcast just don't do it.

...so IT DOES the job after all ;-)

Now how do we find you again  8-)

Regards
Reinhold
............

Offline cbacani

  • *
  • 111
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #8 on: September 14, 2007, 10:53:25 PM »
Yes it does the job but I really didn't want to stream the station around the world. Just to the people who take the time to visit.

As to : Now how do we find you again? I don't understand.

Carl

Offline Reinhold

  • *
  • 517
  • +0/-0
    • http://127.0.0.1
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #9 on: September 14, 2007, 11:06:39 PM »
Yes it does the job but I really didn't want to stream the station around the world. Just to the people who take the time to visit.

As to : Now how do we find you again? I don't understand.

Carl

As it is unlikely that you are
"S K Y . F M "  or "DIGITALLY IMPORTED"
and I didn't find "CBACANI"  or "CarlFM"
we would need some more info to "listen live"

Regards
Reinhold
............

Offline cbacani

  • *
  • 111
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #10 on: September 14, 2007, 11:31:27 PM »
After we get our stuff together I will post all of the information. Right now we are involved in the FM transmitter area and the streaming aspect tested great. We purchased all of the licenses and additional stuff that goes with it. What a project! The FCC is the last agency that needs to be done.

We didn't broadcast over to Shoutcast ( you can make it public or private ) and it did work. Maybe with enough brains put together this project might make it.

Copyright laws were not an issue as Old Time Radio copyrights expired a long time ago. I think we did run into a few that our STILL in force according to my attorney ie: The Shadow Knows and such. As you can guess they were removed from the computer and flushed in a quick hurry!

ASCAP and BMI and the other were easy, just pay the money and you can broadcast for 1 year and pay again. If you want to know how much it was, it was around 750 dollars for the year for all of them.

This 'not for profit' station will not be paid by any commerical company although we do run old time
commercials. We were really setback when we heard some of the radio programs. The way people talked to each other and some of the subject material was in very BAD TASTE.

Some additional things to be taken care of and away we go. SME server is running all of it including Radio Station Automation where nobody has to be there to do anything. Set it up for the week and walk away. Sam Broadcster is handling the backend - great program and cheap to.

Have a great weekend and again thank you for your ideas and help.

Carl

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #11 on: September 15, 2007, 10:29:03 AM »
Carl.
Thank you very much for share you shoutcast howto  :shock:

One question. Is there a way to use the local (SME) audio board to stream the shoutcast server, and not use windows with winamp?

Thank you

Offline Helgo

  • ***
  • 51
  • +0/-0
    • home website
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #12 on: September 15, 2007, 10:58:06 AM »
sorry for my bad English.

If you want to use media-player make a file like music.m3u and in this file you set the ip adres of your shoutcast.
then connect to this file.


Helgo
......

Offline cbacani

  • *
  • 111
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #13 on: September 15, 2007, 12:14:50 PM »
Carl.
Thank you very much for share you shoutcast howto  :shock:

One question. Is there a way to use the local (SME) audio board to stream the shoutcast server, and not use windows with winamp?

Thank you

We tried Muse and it allowed us the stream and also shout to the yp. Oddcast with the Linux dsp worked using the internal sound card and a internal playlist.

Another one that really looks good was located at http://www.webhostingtalk.com/showthread.php?t=275976
but I did not have enough time to set it up and fix the install problems but it really should be examined by someone that has the time and skills to 'make it happen'. If someone does it PLEASE let me know.

If SAM would make a version for Linux I would drop the Windows head end in a heartbeat.

Carl

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #14 on: September 15, 2007, 11:27:50 PM »
Hi Carl
Well, I have installed under bin in the same directory of shoucast.
Configure the conf file (password and localhost) and run ok with playlist and direct audio from soundcard. Previously I have detect card with kudzu. The only for test purposes I have run directly in command line ./sc_trans_linux

I will try other methods you have say (MUSO-Oddcast) and post here the results.

Offline cbacani

  • *
  • 111
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #15 on: September 16, 2007, 02:22:47 PM »
Thank you - Thank you very much. This is something that needs to be explored and with your help - other people will also benefit. The SME server has the ability to do just about anything that we can imagine. I really wish someone would produce some automated radio broadcast software that could get the job done.

I will also try this running that script sometime this week and maybe we can compare notes.

Carl

Offline beakersloco

  • ****
  • 142
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #16 on: January 05, 2008, 03:14:35 AM »
So can this be done from a dynamic ip address .. using the dns name ?

This looks like something I might like to try so that when I am out of town in a hotel or at work ...stream the music from my home connection.
All that's necessary for the forces of evil to win in the world is for enough good men to do nothing.???" Edmund Burke -Irish orator, philosopher, & politician


For the battle is not yours, but God's.   2 Chronicles 20:15

Offline imcintyre

  • *
  • 609
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #17 on: January 05, 2008, 04:17:09 AM »
I think this how to or contrib is overkill for what you want to do. I am able to play music from home server using openvpn contrib, log onto network and get to appropriate directory on the sme box where the music is stored and then select the files you want to play and let windows media player do the rest.


Offline sandoz

  • ***
  • 47
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #18 on: April 02, 2008, 07:38:32 PM »
i am trying to get this howto to work for my shoutcast server
everything seems to be working ok, i can connect locally to 192.168.1.110:8000, where i see the winampserver
however, when i try this outside the LAN, i am not able oto connect
on the router, port 8000 and 8001 are forwarded to 192.168.1.110

what am i doing wrong? the webserver is normally working at 80 as are other services

Offline sandoz

  • ***
  • 47
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #19 on: April 02, 2008, 08:45:15 PM »
ok, service masq stop
and it works

shouldn't the command
[root@csserver ~]# config set shoutcast service access public status enabled TCPPorts 8000:8001
do the same?

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #20 on: April 02, 2008, 09:06:46 PM »
ok, service masq stop
and it works

shouldn't the command
[root@csserver ~]# config set shoutcast service access public status enabled TCPPorts 8000:8001
do the same?
Please, no stop the masq service because this is the firewall!

Use the command you have wroted:
Quote
config set shoutcast service access public status enabled TCPPort 8000:8001
signal-event remoteaccess-update
« Last Edit: April 02, 2008, 11:49:39 PM by Normando »

Offline sandoz

  • ***
  • 47
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #21 on: April 02, 2008, 09:28:40 PM »
done that, but it doesn't work, ip:8000 is not loading

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #22 on: April 02, 2008, 11:51:44 PM »
TCPPort not TCPPorts

Can you read the wiki please?

Offline sandoz

  • ***
  • 47
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #23 on: April 03, 2008, 08:50:02 AM »
i used TCPPorts, not TCPPort, i read the wiki and i cannot find it in the wiki
still not working

Offline raem

  • *
  • 3,972
  • +4/-0
...

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #25 on: April 03, 2008, 09:04:50 AM »
i used TCPPorts, not TCPPort, i read the wiki and i cannot find it in the wiki
still not working

The correct way is TCPPort

Ray was advice you

Offline sandoz

  • ***
  • 47
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #26 on: April 03, 2008, 10:58:21 AM »
ok, my fault
now i used the TCPPort, but still nothing

how do i list the masq entries?
in iptables -L i cannot find anything regarding port 8000

Offline jfarschman

  • *
  • 406
  • +0/-0
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #27 on: October 08, 2008, 04:39:48 PM »
Carl...

  Bounce me your email address.  jay@hitechsavvy.com

  Thanks.  I am told that you may have tried to call me while I was out.

Your Friend,
Jay
Jay Farschman
ICQ - 60448985
jay@hitechsavvy.com

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Re: Old Topic - Need Better Solution "Streaming Audio to a web site"
« Reply #28 on: October 09, 2008, 06:04:44 AM »
ok, my fault
now i used the TCPPort, but still nothing

how do i list the masq entries?
in iptables -L i cannot find anything regarding port 8000

As this thread got bumped....

[root@tiger ~]# iptables -L | grep 8000
[root@tiger ~]# config set shoutcast service access public status enabled TCPPorts 8000:8001
[root@tiger ~]# signal-event remoteaccess-update
[root@tiger ~]# iptables -L | grep 8000
ACCEPT     tcp  --  anywhere             tiger.magicwilly.info tcp dpts:8000:8001

[root@tiger ~]# config delete shoutcast
[root@tiger ~]# signal-event remoteaccess-update
[root@tiger ~]# iptables -L | grep 8000
[root@tiger ~]# config set shoutcast service access public status enabled TCPPort 8000:8001
[root@tiger ~]# signal-event remoteaccess-update
[root@tiger ~]# iptables -L | grep 8000

[root@tiger ~]# config delete shoutcast
[root@tiger ~]# signal-event remoteaccess-update
[root@tiger ~]# iptables -L | grep 8000
[root@tiger ~]# config set shoutcast service access public status enabled TCPPort 8000     
[root@tiger ~]# signal-event remoteaccess-update
[root@tiger ~]# iptables -L | grep 8000
ACCEPT     tcp  --  anywhere             tiger.magicwilly.info tcp dpt:8000
[root@tiger ~]#



Both TCPPorts and TCPPort are valid for their intended purpose.




« Last Edit: October 09, 2008, 06:16:46 AM by william_syd »
Regards,
William

IF I give advise.. It's only if it was me....