Page 1 of 1

Stopping a command line VLC stream

Posted: 19 Nov 2006 11:40
by pcheng
I am trying to create a program that will start a VLC stream using a file and then when the user selects it should stop the VLC stream and start a new stream using a different file.

To stop VLC I am currently using killall vlc which I think its a bad way to do it. Could you tell me if there is a command to stop the stream within my program code?

Thanks

Posted: 19 Nov 2006 13:07
by funman
if you run vlc with the telnet interface, you should be able to send it a 'quit' command

Posted: 20 Nov 2006 07:57
by pcheng
I run VLC through the program code by using: system("vlc ... &");

This allows me to run VLC and then continue running the code while the stream is being sent. How can I stop the stream after some time has passed?

In telnet i used vlc -I rc and used quit to stop it but that would be problematic in the program code.

Posted: 24 Nov 2006 06:06
by tsr
not sure if it helps, but here's my bash script that I use to rip various streams:

Code: Select all

/usr/local/bin/mplayer -quiet -dumpstream -dumpfile ~/rip/$filename $url 2>> /dev/null >> /dev/null & echo $! >/tmp/$filename.pid sleep $length && kill `cat /tmp/$filename.pid`
this can be applied to VLC just in the same fashion.
and with a little bit of imagination you can probably see what the individual variables are for. but since this is a bash-only script, i am not sure if it helps. if you want to implement it into a C / C++ app, then it will most certainly be bad style to use bash.