| View previous topic :: View next topic |
| Author |
Message |
Anonymous Guest
|
Posted: Mon Jun 09, 2008 2:25 am Post subject: Start an external program when listener try to connect |
|
|
Hello. I use VLC to transcode mms stream to mp3 and send it to icecast.
I want to execute vlc only when somebody try to listen, and when there are no listeners, vlc should to stop.
My config:
| Code: |
<relay>
<server>localhost</server>
<port>8001</port>
<mount>/</mount>
<local-mount>/next</local-mount>
<on-demand>1</on-demand>
<relay-shoutcast-metadata>1</relay-shoutcast-metadata>
</relay>
<mount>
<mount-name>/next</mount-name>
<stream-name>NEXT</stream-name>
<bitrate>64</bitrate>
<on-connect>/home/radio/vlc_init start 8001 'http://audio.rambler.ru/play.html?id=366053' 64</on-connect>
<on-disconnect>/home/radio/vlc_init stop 8001</on-disconnect>
</mount> |
But when i try listen, icecast doesn't execute my scripts... What's wrong? |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Mon Jun 09, 2008 3:45 am Post subject: |
|
|
icecast will supply a mountpoint arg to the script, you don't embed it into the name like you have specified.You would need to place that in a script that calls vlc_init
It's not clear from your description if vlc is supped to create the stream on localhost:8001/ , if so then the script won't run as the stream doesn't exist to start with. You could use auth url listener_add as the trigger instead.
karl. |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Mon Jun 09, 2008 4:50 am Post subject: |
|
|
Thanks, listener_add works But can i use it without authentication? For example, winamp requests login and password when i try to listen... |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Mon Jun 09, 2008 12:46 pm Post subject: |
|
|
The code in icecast for listener_add does not require a username and password, your script however can require whatever it likes. As long as you send back the header to accept a listener then your script can do whatever it likes.
karl. |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Mon Jun 09, 2008 11:57 pm Post subject: |
|
|
Thanks, now it works excellent!  |
|
| Back to top |
|
 |
|