Old 1st February 2015, 21:52   #1
Holly1605
Junior Member
 
Join Date: Feb 2015
Posts: 4
Switching streams

Hi Everyone

I am after some advice on how to switch streams in SHOUTcast server.

I currently have a virtual server hosting a website and running SHOUTcast server. I then have WinAmp and SHOUTcast host running on my PC.

I would like to be able to switch between two streams from different PC's.

Does anyone know if this is possible and how I would achieve it. Ideally I would like to use some kind of script to switch between them.

Any help would be much appreciated.

Thanks

Holly
Holly1605 is offline   Reply With Quote
Old 2nd February 2015, 07:40   #2
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,290
liquidsoap

"If you don't like DNAS, write your own damn system"

So I did
jaromanda is offline   Reply With Quote
Old 2nd February 2015, 11:32   #3
Holly1605
Junior Member
 
Join Date: Feb 2015
Posts: 4
Switching streams

Thank you for your reply jaromanda.

I'm not familiar with liquidsoap but I have heard of it. Is it the dj intervention that I should be looking at? Would liquidsoap replace anything I am currently using or would it running along side my current applications?

Your help is very much appreciated
Holly1605 is offline   Reply With Quote
Old 2nd February 2015, 11:45   #4
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,290
the way I see it, liquidsoap as the destination for the two streams, and it would stream the "chosen" stream to DNAS

liquidsoap has a steep learning curve, but it does have a powerful "scripting" language.

you've not really described the criteria for switching streams. What's the criteria for switching? time based? just when you feel like it? or is one stream "constant" until the other is up, then it takes precedence? Something else I haven't thought of?

liquidsoap is quite powerful in the right hands - http://savonet.sourceforge.net/doc-s...lete_case.html - in reality, that script is 17 lines long (the rest are comments and commands split over multiple lines) and that gets you the following setup

• play different playlists during the day;
• play user requests – done via the telnet server;
• insert about 1 jingle every 5 songs;
• add one special jingle at the beginning of every hour, mixed on top of the normal stream;
• relay live shows as soon as one is available;
• and set up several outputs.

"If you don't like DNAS, write your own damn system"

So I did
jaromanda is offline   Reply With Quote
Old 3rd February 2015, 11:48   #5
Holly1605
Junior Member
 
Join Date: Feb 2015
Posts: 4
Thanks Jaromanda

I want some users to be able to log in to the website and maybe click a button that will switch the stream to them (their Winamp and shoutcast host on their local machine) they can then stream their show and then click a button to set it back to the original stream (playing the playlist)

I would like to also (if possible) set a time limit if possible just incase they forget to switch back. So say they do a 2hour show...after 2hours and 15 mins it will automatically switch back.

Easier said than done I believe but does this sound like something I could achieve in liquid soap?
Holly1605 is offline   Reply With Quote
Old 3rd February 2015, 12:15   #6
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,290
liquidsoap will do that, you don't have to "switch" manually - i.e. no click on a website for a DJ to stream over the top of a playlist, they just start streaming to the "input harbour" as liquidsoap calls it, and, if your liquidsoap script is written correctly, the incoming stream will be streamed out instead of the playlist - when they disconnect, it will start playing the playlist again ... you can even have silence detection so, if they stop everything except the stream (i.e. stream silence) the playlist can kick in

The script I linked to above does most of that already (I don't think it does silence detection on the DJ stream)

From what you've described, liquidsoap will do exactly what you want, even easier than your description, and you'll only be touching a fraction of liquidsoaps functionality

"If you don't like DNAS, write your own damn system"

So I did
jaromanda is offline   Reply With Quote
Old 3rd February 2015, 12:19   #7
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,290
actually, that's not the best example - it doesn't use input harbour ... hang on, I'll find a good example

"If you don't like DNAS, write your own damn system"

So I did
jaromanda is offline   Reply With Quote
Old 3rd February 2015, 12:25   #8
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,290
HTML Code:
# ip to listen to - 0.0.0.0 means any/all
set("harbor.bind_addr","0.0.0.0")

# An emergency file - when all else fails, this gets played
emergency = single("/path/to/emergency/single.ogg")

# A playlist
playlist = playlist("/path/to/playlist")

# A live source
live = input.harbor("/",port=8080,password="hackme")

# fallback
radio = fallback(track_sensitive=false,[live,playlist,emergency])

# output it
output.shoutcast(%mp3(bitrate=128,samplerate=44100,stereo=true),
                name="Radio Station",
                genre="Genre",
                host="127.0.0.1",
                port=8000,
                password = "changeme",
                radio)
That's a pretty basic but fully functional liquidsoap script (once you change the obvious bits you need to change) - it does what you want (again, it wont automatically disconnect the live stream if it's silent - I don't know liquidsoap that well to show an example)

"If you don't like DNAS, write your own damn system"

So I did
jaromanda is offline   Reply With Quote
Old 3rd February 2015, 13:23   #9
Holly1605
Junior Member
 
Join Date: Feb 2015
Posts: 4
Thanks again jaromanda

I will give it a go and keep you posted. Your assistance is massively appreciated
Holly1605 is offline   Reply With Quote
Old 7th February 2015, 11:04   #10
neralex
Major Dude
 
Join Date: Mar 2011
Posts: 576
jaromanda, it seems you have some expierence with liquidsoap. I have some questions about your posted example:

1. Is it possbile to add scheduled playlists - I mean playlists with a fixed timestamp, like: 06.02.2015 - 19:00:00, 06.02.2015 - 20:00:00 etc.?

2. Is it possible to add different user-account for the live source and if yes, must have every new live-user a new port or can i add different live-users with their passwords on the same port like:

live1 = input.harbor("/",port=8080,password="hackme1")
live2 = input.harbor("/",port=8080,password="hackme2")

Exists in liquidsoap priorities to for live-users to make sure that "live1" can not kick "live2"?
neralex is offline   Reply With Quote
Old 7th February 2015, 13:25   #11
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,290
I just noticed an error in what I posted, the fallback line should read

# fallback
radio = fallback(track_sensitive=false,[live,playlist,emergency])


From what I know:

1. yes, playlists can be scheduled for different times/days etc - I've seen some pretty crazy stuff with playlists and jingles etc

2. I believe if you want different passwords for different accounts, you would need a port for each. As for priority, the "fallback" list in the example is from highest to lowest priority, so, if the fallback line above is ..... [live1,live2,playlist,emergency] .... and live1 and live2 are the two "harbours" - then live1 would have priority over live2, which has priority over the playlist, which has priority over emergency. It may even be possible to have different priorities at different times, e.g. if you wanted live2 to have priority at a particular time of day or something like that - but that's getting into some more complex scripting than I've ever needed or contemplated.

My knowledge of liquidsoap isn't that good, you'd be best to ask on the liquidsoap mailing list

"If you don't like DNAS, write your own damn system"

So I did
jaromanda is offline   Reply With Quote
Old 7th February 2015, 17:57   #12
neralex
Major Dude
 
Join Date: Mar 2011
Posts: 576
Thanks for the reply. It's sad there exist no forum for liquidsoap. I know the mailing list but this is hard to read and follow. I'm also not sure if i can use the same liquidsoap instance for more than one stream. Airtime is to much for me. I have to manage 3 streams and all have their own scheduled playlists and stream-users. If i understand it correctly, then a liquidsoap instance needs many perfomance.

Currently i manage all 3 streams with sc_trans and DNAS deamons for each stream and it works with a low performance. But it seems liquidsoap is not really what i search for multi-stream support like sc_trans.
neralex is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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