Page 1 of 1

daemon mode help - anything that fully describes this mode..

Posted: 03 Aug 2005 19:23
by unixman
hi, thanks in advance for any help

i am seeking any help on the status of the daemon mode in VLC 0.8.2

specifically: i'd like to know about any protocol that supports streaming requests (i.e. while running in daemon mode; what requests and what responses are available in/out of VLC?)

also: has anyone had any success in using popen() to open a VLC process from a C app, and then piping (via popen into VLC's STDIN) a file ((wave) audio in this case) file to drive a stream output? this works fine from the command line just fine, but i don't see anthing, anywhere that says this might have been done...

ultimately: i'd like just use a protocol in the daemon mode to make streaming requests

thanks so much for any help!

VLC and the Development Team are the only True Rock Stars!

Posted: 03 Aug 2005 23:34
by DeftonesXP
In my project I am currently using unix shell scripts to record and play videos. Its a very ugly code, but it's working great.

Here's what I do :

1) On the server, create a sh file. ex: playvideo.sh
2) put a vlc remote command in it :

Code: Select all

#!/bin/sh ( echo open 192.168.0.100 6001 sleep 0.5 echo add /share/mp2/video.mp2 :sout="#duplicate{dst=standard{access=udp,mux=ts,url=192.168.1.101:1234}}" ) | telnet
3) start vlc with the RC interface on the video server :
(If you are using the windows vers. of vlc as a server, be sure to add --rc-quiet to your shortcut...)

Code: Select all

vlc -v -I rc --rc-host 192.168.1.100:6001
I use some php code and the exec() function to call the .sh script. That way, I can ask my server to play my video from any browser.
ex. play.php

Code: Select all

<? $play_command = "/share/scripts/playvideo.sh"; exec($play_command); ?>
You might be able to create a socket connection and push these commands instead of calling a php/sh script.

Hope this will help

DeftonesXP

great!

Posted: 04 Aug 2005 00:34
by unixman
thanks!

i see the construct of the telnet command that was (apparently) not getting through to me.

this gets me much closer to my intended... :)


...so if you were to change your sh script to:

Code: Select all

#!/bin/sh ( echo open 192.168.0.100 6001 sleep 0.5 echo add $1 :sout="#duplicate{dst=standard{access=udp,mux=ts,url=192.168.1.101:1234}}" ) | telnet

and then use a variable (from javascript or php) in a form, to provide:

Code: Select all

<? $play_command = "/share/scripts/playvideo.sh $selector_value"; exec($play_command); ?>

you would have a video selector!

-

my app is actually writing/creating the content (audio) in real time and i wanted to pipe/send that into vlc
(either from a normal file (i.e. what is already being writtten as the audio is created)

or

fifo (i.e. write to a fifo (instead of the above file) - whichever will work) to produce a stream (some in-transit delay is expected)

so - this helps as i'll be able to make the telnet thing happen to test the 'near-real-time' audio-to-stream and see how that 'plays out' ;)

thanks a bunch

VLC and the Development Team are the only True Rock Stars!