Page 1 of 1

Change input in a VLM element

Posted: 12 Jun 2008 17:33
by vice
Excuse for reposting this text, but I think this is the correct place, sorry.

I'm trying to figure out how to change the input of a VLM element by VLM commands and haven't found anything. I'm trying to use the input list of a broadcast VLM element as a basic playlist, but I need the command to select the input number.

I'm scripting remotely a VLC media player a this could be very usefull to implement some kind of switching functionality to the broadcast VLM elements.

My fisrt input is a live stream so its never ends, but I need to switch to others inputs on demand.

For example, we could relay a live streaming and from time to time switch to some anouncement, advertisement, replay action or whatever. With the option sout-keep to keep the streaming going.

If this is imposible, the only way to do it is:
  • 1. Stop the VLM element, destroy its input, set the new input, and play again the VLM element. Restart the process to get back to the old input.
    2. Or, Stop and play differents VLM elements all of them with the same output.
    3. Use the VLC media player own playlist and forget about VLM.
Searching for possible VLM commands, I found:
control (name) [instance_name] (command)
with control commands:
play, stop, pause and seek.

of all those, seek sounds promising but it only handles seeking in the current input (I understand), perhaps we could add a new control command like this:

Code: Select all

control (name) [instance_name] inputn (input number)
or play command with opcional input number:

Code: Select all

control (name) [instance_name] play [input number]
event extend the seek control command with an optional input number, so it could be written:

Code: Select all

control (name) [instance_name] seek [+-](percentage) | [+-](seconds)s | [+-](milliseconds)ms [input number]
Where could I found more information about VLM commands?
If this functionality is missing, could it be a good adition?
I don't think this could be hard to implement.

Thanks in advance!

Re: Change input in a VLM element

Posted: 13 Jun 2008 13:29
by vice

Code: Select all

control (name) [instance_name] play [input number]
implemented for the upcomming 0.9 version.
(Saw in git repository)

Re: Change input in a VLM element

Posted: 26 Jun 2008 16:09
by yohann.martineau
in this case, how must we create the vod?

Code: Select all

new test vod enabled setup test input /home/my/file.mpg 1 setup test input /home/my/file2.mpg 2 setup test output #std{access=udp,mux=ts,dst=1.2.3.4:1234} control play test 1 control play test 2
Like this?

Re: Change input in a VLM element

Posted: 03 Jul 2008 10:22
by vice
in this case, how must we create the vod?

Code: Select all

new test vod enabled setup test input /home/my/file.mpg 1 setup test input /home/my/file2.mpg 2 setup test output #std{access=udp,mux=ts,dst=1.2.3.4:1234} control play test 1 control play test 2
Like this?
No, I don't think that works. But you need to try it.
I think you can't send a control play command to a VOD element. The VOD play is controlled by the client a not by VLM commands.
(Remenber to try, just in case...)
But if you create instead a broadcast element with lines similar to the first 4, you can control what input is playing by sending VLM commands like those in lines 5 and 6.

And remenber that this only works for the forcomming 0.9 version.

Re: Change input in a VLM element

Posted: 04 Jul 2008 11:14
by yohann.martineau
ok, thank you for your answer.

I've tried the following commands with latest sources (0.9.0-test2)

Code: Select all

> new test broadcast enabled > setup test input /home/yohann/media/out/ad_mercedes.mpg 1 setup : Wrong command syntax
how did you configure vlc?

I configured vlc with the following line:

./configure --disable-qt4 --disable-skins2

and i launched vlc with this command line:

./vlc -I telnet --rtsp-host 0.0.0.0:5554

Re: Change input in a VLM element

Posted: 07 Jul 2008 09:54
by vice
[quote="yohann.martineau"]

Code: Select all

> new test broadcast enabled > setup test input /home/yohann/media/out/ad_mercedes.mpg 1 setup : Wrong command syntax
I think the wrong command syntax could be because of the last number that you put at the end of the line.
As far as I know you only can setup input <and the media location> or MRL as the VLC Team like to name.

So because you can't put any input number, the list are ordered as you enter input commands first setup input determines the first input and so on with the followings setup input commands.

Re: Change input in a VLM element

Posted: 08 Jul 2008 10:38
by yohann.martineau
ok, thank you for your reply. I will perform some tests with input order, without this explicit number.

thanks,

yohann

Re: Change input in a VLM element

Posted: 08 Jul 2008 11:21
by xsimio
use:
inputn X

is working for me.

Re: Change input in a VLM element

Posted: 15 Aug 2008 00:19
by novamxd
*bump*

You could also try something like:

Code: Select all

new broad1 broadcast enabled setup broad1 input *live stream* setup broad1 output #transcode{acodec=mp4a,ab=128,channels=2}:std{access=http,mux=ts,dst=127.0.0.1:1000} new broad2 broadcast enabled setup broad2 input "c:\addvert1.mp3" setup broad2 output #transcode{acodec=mp4a,ab=128,channels=2}:std{access=http,mux=ts,dst=127.0.0.1:1000} new mystream vod enabled setup mystream input "127.0.0.1:1000"
Toggle them by:

Code: Select all

control broad1 stop control broad2 play or control broad1 play control broad2 stop
Access via RTSP:

Code: Select all

rtsp://*serveraddr*/mystream

Re: Change input in a VLM element

Posted: 26 Aug 2008 10:59
by publicENEMY
*bump*

You could also try something like:

Code: Select all

new broad1 broadcast enabled setup broad1 input *live stream* setup broad1 output #transcode{acodec=mp4a,ab=128,channels=2}:std{access=http,mux=ts,dst=127.0.0.1:1000} new broad2 broadcast enabled setup broad2 input "c:\addvert1.mp3" setup broad2 output #transcode{acodec=mp4a,ab=128,channels=2}:std{access=http,mux=ts,dst=127.0.0.1:1000} new mystream vod enabled setup mystream input "127.0.0.1:1000"
Toggle them by:

Code: Select all

control broad1 stop control broad2 play or control broad1 play control broad2 stop
Access via RTSP:

Code: Select all

rtsp://*serveraddr*/mystream
Doesnt work. heres my command
new broad1 broadcast enabled
setup broad1 input C:\Videos\video1.avi
setup broad1 output #duplicate{dst=std{access=http,mux=ts,dst=127.0.0.1:1234}}

new broad2 broadcast enabled
setup broad2 input C:\Videos\video2.avi
setup broad2 output #duplicate{dst=std{access=http,mux=ts,dst=127.0.0.1:1234}}

new stream1 vod enabled
setup stream1 input "127.0.0.1:1234"

control broad1 play
control broad2 stop
and in vlc
rtsp://10.44.39.89:5554/stream1
gives the error
Unable to open 'rtsp://10.44.39.89:5554/stream1'
when i tried play streams from 127.0.0.1:1234(which is broad1), it works fine.

please help.

Re: Change input in a VLM element

Posted: 26 Aug 2008 22:20
by dionoea
Suppose you have this:

Code: Select all

new foo broadcast enabled input somefile.mpeg control foo play
To change the input list you can use:

Code: Select all

setup foo inputdel all input someotherfile.mpeg
I suggest that you run the telnet interface and type "help" to get all the available commands.

Cheers,

Re: Change input in a VLM element

Posted: 03 Sep 2008 13:06
by vice
Suppose you have this:

Code: Select all

new foo broadcast enabled input somefile.mpeg control foo play
To change the input list you can use:

Code: Select all

setup foo inputdel all input someotherfile.mpeg
I suggest that you run the telnet interface and type "help" to get all the available commands.

Cheers,
So this is basically the method described in my first post as number 1 but without stopping and starting the VLM element. Does it works? Has anybody tried it?

If I can test it I post results here.

Re: Change input in a VLM element

Posted: 03 Sep 2008 15:02
by dionoea
It should work :) Maybe you have to add the new input first and the delete the other inputs one by one.

Re: Change input in a VLM element

Posted: 04 Sep 2008 05:39
by publicENEMY
i believe, telnet interface does not work properly under windows.

Re: Change input in a VLM element

Posted: 04 Sep 2008 14:10
by dionoea
It works fine :) It just doesn't work fine with the native windows telnet client. Try another one like putty.

Re: Change input in a VLM element

Posted: 05 Sep 2008 05:12
by publicENEMY
i have tried using putty and while it does work, it also crash frequently, just not as frequent as windows client.

maybe thats just me.

Re: Change input in a VLM element

Posted: 14 Oct 2008 04:12
by hillbilly1980
I've tried the inputdel all method and it doesn't switch streams unless you stop and then restart the broadcast control. I'm still trying to work how to broadcast to 127.0.0.1:1000 and switch using the vod method but keep gettign "no access modules" found and the like.

Re: Change input in a VLM element

Posted: 03 Jun 2010 14:48
by chinnaedu
if anyone here came up with any solution to this please do post here....
Thank you