Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Start an external program when listener try to connect

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Mon Jun 09, 2008 2:25 am    Post subject: Start an external program when listener try to connect Reply with quote

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
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Mon Jun 09, 2008 3:45 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Mon Jun 09, 2008 4:50 am    Post subject: Reply with quote

Thanks, listener_add works Smile 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
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Mon Jun 09, 2008 12:46 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Mon Jun 09, 2008 11:57 pm    Post subject: Reply with quote

Thanks, now it works excellent! Smile
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber