Old 21st July 2014, 19:26   #1
trahma
Junior Member
 
Join Date: Sep 2001
Posts: 9
sc_trans relay and remote app question

I realize sc_trans is out of support, was hoping someone here may have some experience with my use case.

My station uses the remote application playlist control that calls a script I've written to retrieve the next song to play. I would ideally like to have the option to tell it to relay a url but returning a URL instead of a filename seems to not work for me.

I'm attempting to achieve allowing DJs to connect to an sc_serv instance so they can test their connection, and then have sc_trans relay that connection to live.

Anyone have any suggestions for how to achieve this with sc_trans?
trahma is offline   Reply With Quote
Old 21st July 2014, 20:13   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
Quote:
Originally Posted by trahma View Post
My station uses the remote application playlist control that calls a script I've written to retrieve the next song to play. I would ideally like to have the option to tell it to relay a url but returning a URL instead of a filename seems to not work for me.
that won't work, that feature only works on local files.
DrO is offline   Reply With Quote
Old 26th September 2014, 16:52   #3
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 534
Send a message via AIM to dopelabs
hehe.. this sounds familiar... i currently have a setup ver similar if not identical to what you are describing....

you want a staging server system... one private server for the djs to connect to, and one live server thats broadcasting archived content until the dj is ready to broadcast.. the dj can connect and be able to stream to the private instance of shoutcast to test their settings agaings the live stream. making sure audio levels match...the dj can enter in a custom song title, and click a button on a web form and the live server will begin to play content from the staging server. once they disconnect, it falls back to archived content (auto dj)...

remember, you can destroy someones soundsystem if the current audio is low volume the listener will be forced to turn up their volume levels on their stereos,etc.. if the dj come on has it cranked up.. you might blow out the listners entire system...

ill tell you what.. you can hit me up and we can discuss this further... in the mean time i will write up some docs on a few different ways to achieve this goal using current (and free!) streaming tools.
dopelabs is offline   Reply With Quote
Old 26th September 2014, 21:05   #4
Bryon Stout
Senior Member
 
Join Date: Feb 2011
Posts: 377
Dopelabs is the man. Really cool dude to talk to and I suggest you take him up on your offer and chat with him a bit. Very knowledgeable.
Bryon Stout is offline   Reply With Quote
Old 26th September 2014, 22:35   #5
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 534
Send a message via AIM to dopelabs
http://www.dlnetworks.net/scratch/li...aming-example/
dopelabs is offline   Reply With Quote
Old 27th September 2014, 01:59   #6
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 534
Send a message via AIM to dopelabs
a quick example using liquidsoap

connects to a remote shoutcast server and transcodes to aac and mp3 and rebroadcasts to multiple shoutcast servers.

shoutast based sources (djs) connect, switching from the remote source to the live source immediately, and back on disconnect


code:

#!/usr/bin/liquidsoap

# set full path to logfile
set("log.file.path","/var/log/liquidsoap/radiostation.log")

# enable daemon mode
set("init.daemon",true)

# change to run under a custom user/group
set("init.daemon.change_user",true)
set("init.daemon.change_user.group","username")
set("init.daemon.change_user.user","groupname")

# do not create a pid file
set("init.daemon.pidfile",false)

# ip to listen on for djs and sources
set("harbor.bind_addr","127.0.0.1")

# remote source to be transcoded
url = "http://www.remotehost.com:8000"
relay = mksafe(input.http(url))

# port and pass for djs
live = input.harbor("/",port=8000,password="djpassword")

# local file
emergency = single("/path/to/some/lastresort.mp3")

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

# output to shoutcast servers
output.shoutcast(%mp3(bitrate=256,samplerate=44100,stereo=true),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8000,password = "changeme",radio)
output.shoutcast(%mp3(bitrate=128,samplerate=44100,stereo=true),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8010,password = "changeme",radio)
output.shoutcast(%mp3(bitrate=64,samplerate=44100,stereo=true),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8020,password = "changeme",radio)
output.shoutcast(%mp3(bitrate=24,samplerate=22050,stereo=false),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8030,password = "changeme",radio)
output.shoutcast(%aac(bitrate=256),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8000,password = "changeme",radio)
output.shoutcast(%aac(bitrate=128),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8010,password = "changeme",radio)
output.shoutcast(%aac(bitrate=64),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8020,password = "changeme",radio)
output.shoutcast(%aac(bitrate=24),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8030,password = "changeme",radio)




this can be easily modified to just play a directory of media and perform the same live dj switching:


code:

#!/usr/bin/liquidsoap

# set full path to logfile
set("log.file.path","/var/log/liquidsoap/radiostation.log")

# enable daemon mode
set("init.daemon",true)

# change to run under a custom user/group
set("init.daemon.change_user",true)
set("init.daemon.change_user.group","username")
set("init.daemon.change_user.user","groupname")

# do not create a pid file
set("init.daemon.pidfile",false)

# ip to listen on for djs and sources
set("harbor.bind_addr","127.0.0.1")

# remote source to be transcoded
# A playlist
archives = playlist("/some/directory/of/mp3")

# port and pass for djs
live = input.harbor("/",port=8000,password="djpassword")

# fallback function
radio = mksafe(archives)
radio = fallback(track_sensitive=false,[live,archives])

# output to shoutcast servers
output.shoutcast(%mp3(bitrate=256,samplerate=44100,stereo=true),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8000,password = "changeme",radio)
output.shoutcast(%mp3(bitrate=128,samplerate=44100,stereo=true),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8010,password = "changeme",radio)
output.shoutcast(%mp3(bitrate=64,samplerate=44100,stereo=true),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8020,password = "changeme",radio)
output.shoutcast(%mp3(bitrate=24,samplerate=22050,stereo=false),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8030,password = "changeme",radio)
output.shoutcast(%aac(bitrate=256),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8000,password = "changeme",radio)
output.shoutcast(%aac(bitrate=128),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8010,password = "changeme",radio)
output.shoutcast(%aac(bitrate=64),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8020,password = "changeme",radio)
output.shoutcast(%aac(bitrate=24),name="Radio Station",genre="Genre",host="127.0.0.1",port = 8030,password = "changeme",radio)

dopelabs is offline   Reply With Quote
Old 27th September 2014, 04:01   #7
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,289
one hurdle left for liquidsoap - streaming to a DNAS2 server using Ultravox 2.1 protocol - only then can it be considered a worthy successor to sc_trans 2

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

So I did
jaromanda is offline   Reply With Quote
Old 27th September 2014, 04:04   #8
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 534
Send a message via AIM to dopelabs
is there anything that can current stream to dnas2 using UV2.1?
dopelabs is offline   Reply With Quote
Old 27th September 2014, 04:18   #9
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,289
No, but google search suggests a C++ library has been written. Unfortunately, it's not "open" at all.

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

So I did
jaromanda is offline   Reply With Quote
Old 27th September 2014, 04:22   #10
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 534
Send a message via AIM to dopelabs
ill have to go look at what features are specific to uv2.1... that cant be done using other tools...
dopelabs is offline   Reply With Quote
Old 27th September 2014, 04:32   #11
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,289
Quote:
Originally Posted by dopelabs View Post
ill have to go look at what features are specific to uv2.1... that cant be done using other tools...
multiple source streams to 1 instance of DNAS - i.e. your example above requires 4 instances of DNAS so that liquidsoap can source the 4 different bitrates, with sc_trans v2 you could do it with one DNASv2

edit: don't get me wrong, I think liquidsoap is the shiz. I've been pushing it around here for a while too! It's just the lack of "native" support for UltraVox 2.1 - if I could get my head around the ocaml language, I'd write it myself. I know the UltraVox 2.1 protocol fairly well, I've been writing stuff using it for a couple of years, just not source client (yet)

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

So I did
jaromanda is offline   Reply With Quote
Old 27th September 2014, 04:46   #12
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 534
Send a message via AIM to dopelabs
(thats 8 different dnas's in the above example) =]

as i ponder.. its not like its a hog when in 'v1' mode. generally speaking you will run out of network resouces before you will system resources.. i have never found sc_serv to be of any real performance hog... but this would also post the threat that if anything did go wrong.. and your using v2..and it crashes.. alll your streams are down.. not just a single bitrate out of however many your offering...

im still all for consolidating and being able to have more efficiency...
dopelabs is offline   Reply With Quote
Old 27th September 2014, 04:57   #13
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,289
Yes, multiple DNASv2 each with one stream is not much different to one DNASv2 with multiple streams from a system resource point of view

it's a little more complicated (for the average joe) to setup and maintain (the concept of different ports, multiple config files etc angers and confused some)

I agree that it many ways, it's a trivial issue, like all the minor features of DNASv2 that the liquidsoap method you show misses out on

But the features are there in DNASv2, so why not use them. Liquidsoap devs seem to think they are not legally allowed to use UltraVox 2.1 protocol (google it) - they are wrong, I think they just find the protocol too hard to implement and are using any excuse not to tackle it

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

So I did
jaromanda is offline   Reply With Quote
Old 27th September 2014, 05:12   #14
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 534
Send a message via AIM to dopelabs
after a quick skim of the uv2.1 wiki id have to say teh biggest thing is that its not codec or transport dependent... so not just limited to audio streams.. (does nsv still work/exist?)
dopelabs is offline   Reply With Quote
Old 27th September 2014, 05:20   #15
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,289
nsv (apparently) does not work with DNASv2 - which is a shame

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

So I did
jaromanda is offline   Reply With Quote
Old 27th September 2014, 05:30   #16
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 534
Send a message via AIM to dopelabs
would you even want to use it?... what devices and players support nsv playback.. or even broadcast for that matter...having no dependance on codec or transport wouldnt that mean it opens up to h264 video streams ,etc, opening dnas2 up as a full force media server rather than just radio streams?
dopelabs is offline   Reply With Quote
Old 27th September 2014, 05:40   #17
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,289
winamp supports nsv

I'm confused about your statement re h264 and nsv

NSV is a media container "format", totally codec agnostic. Video codecs that I've seen used were VP3, VP6 or h264. Audio was MP3 or HE-AAC - however, that;s just what I have observed, there may well have been streams using other codecs out there.

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

So I did
jaromanda is offline   Reply With Quote
Old 27th September 2014, 06:20   #18
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 534
Send a message via AIM to dopelabs
i think vlc has support for nsv playback.. i had no idea it was just a container though.. i thought it was its own codec thing since it was sc specific.. ok off topic enough for me on this one to part with: things that would be cool that we will never see...

libapache2-mod-dnas2
ffmpeg -i audio.file -c copy -f dnas2 http://serverort
dopelabs is offline   Reply With Quote
Old 27th September 2014, 11:23   #19
DrO
 
Join Date: Sep 2003
Posts: 27,873
the v2 DNAS does support nsv but its very limited (seeing as nsv is dead and has been for a long time). I've seen 2 stations providing nsv streams with earlier v2 builds so I know it does work of sorts but its not really worth the hassle imho trying to support from any side of the fence as nsv playback support is very limited in clients (even if vlc supports it, there's just not the content).

apparently one of the main liquidsoap devs likes the SC2 protocol but was under the incorrect view point about the licensing - which has been clarified as not the case so will have to see what that clarification leads to.

as for multiple DNAS vs single for all streams, its all a matter of personal preference as to what people use. and its not like its not possible to have multiple v1 source clients connecting to a v2 DNAS with a bit of config tweaking i.e. using more ports subject to title updates not currently working on anything other than stream #1 in that setup for the v1 clients.

so the preferential is having everything in v2 mode but as that's not realistic, we've been adding in things where possible that allow for some of the v2 functionality for v1 fools (which is probably what should have been done from the very start but c'est la vie and is now something we're having to play catch up on).
DrO is offline   Reply With Quote
Old 27th September 2014, 13:49   #20
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 534
Send a message via AIM to dopelabs
theres already support for intro and backup files... and (obviously) support for sources to connect.. it seems like it wouldnt be that far of a stretch to just build an auto dj with live switching into the DNAS..flip a bit to put the dnas into 'internal' or 'auto dj' mode... instead of a single intro or backup file...a directory or playlist... (just thinking outloud here)
dopelabs is offline   Reply With Quote
Old 27th September 2014, 14:06   #21
DrO
 
Join Date: Sep 2003
Posts: 27,873
it's been thought about as well and some aspects of it are already in there (like the means to switch between one source and another if the original one drops).

but if we need to re-process the audio then we get into a mirky area with licensing (as re-eccoding technically needs to be licensed hence what sc_trans had implied on it). if we don't and we just re-align audio frames (which we've done to an extent with the 2.4 release - but needs more work for dropped sources and backup transitions) then can get around most of those sorts of issues.

the main thing i think we're going to see happen is some form of intro file usage being enabled to run when there's no source connected instead of just providing a non-connecting stream. but a full on playlist setup like sc_trans effectively did, i'm not sure and is probably something better served via a dedicated source than trying to bodge something into the DNAS (so i'm not going to commit to anything but it's been thought about).
DrO is offline   Reply With Quote
Old 27th September 2014, 14:17   #22
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 534
Send a message via AIM to dopelabs
heh... i know what ill do... ill create one giant audio file by stitching the entire library of songs together into one looooong file....and set it as the intro... (jokes of obviously)
dopelabs is offline   Reply With Quote
Old 27th September 2014, 14:21   #23
DrO
 
Join Date: Sep 2003
Posts: 27,873
you would be able to do that as there's an upper limit on the size allowed for an intro file (even if it's changed via the config options)

i get the point of the suggestion and really the DJ management aspect from sc_trans is something that should be natively provided via the DNAS (though whether it's done the same or not is debatable) as it's the only real thing which made sc_trans useful imho as anything can transcode / schedule things for playback in all of the other source software out there as needed.
DrO is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Discussions

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