my 2 cents: an http (WebApi) wrapper for VLC's telnet

Want to help the VideoLAN project? Designers, testers, translators, please come...
This is NOT about GETTING some help.
Forum rules
Please read the forum's rules carefully before posting. This forum should not be used to post VLC usage related questions.
mcannistra
New Cone
New Cone
Posts: 4
Joined: 05 Nov 2013 15:22

my 2 cents: an http (WebApi) wrapper for VLC's telnet

Postby mcannistra » 05 Nov 2013 15:33

Hi all.
I want to express my gratitude to the VLC developers with a small sw contribution.
I wanted to remote VLC streaming in my house using an app that I'm still writing.
I searched the web without finding an http api but found everything needed inside the telnet commands documentation.

So during last weekend I decided to write my small contribution. It's just an http wrapper that allows you to connect to your running VLC instance and send it whatever telnet command (existing or future ones).

I know this is very small, is very simple and also not so complete or professional but... it is allowing me to leverage the so great VLC features that we all are enjoying.

You can find the sources on github:

https://github.com/mariocannistra/VLCremotingAPI

I'm using the wonderful "minimalistic telnet" library by Tom Janssens available as open source (http://www.codeproject.com/Articles/190 ... et-library).

Thank you VLC guys and thank you Tom for saving me lots of time around telnet :-)

Hope you enjoy it,
Mario

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: my 2 cents: an http (WebApi) wrapper for VLC's telnet

Postby Jean-Baptiste Kempf » 05 Nov 2013 20:40

Why not use the HTTP/XML or HTTP/JSON to control VLC?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

mcannistra
New Cone
New Cone
Posts: 4
Joined: 05 Nov 2013 15:22

Re: my 2 cents: an http (WebApi) wrapper for VLC's telnet

Postby mcannistra » 05 Nov 2013 21:22

hi.
i've seen that vlc has a browser based interface and i thought it has http/xml or json behind it but... i have not been able to find any docs. so i thought it was not planned for third party app use.
could you please point me to the corresponding documentation ? i would be more than happy to read it...
thank you,
mario

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: my 2 cents: an http (WebApi) wrapper for VLC's telnet

Postby Jean-Baptiste Kempf » 05 Nov 2013 21:24

Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

mcannistra
New Cone
New Cone
Posts: 4
Joined: 05 Nov 2013 15:22

Re: my 2 cents: an http (WebApi) wrapper for VLC's telnet

Postby mcannistra » 05 Nov 2013 21:35

thank you Jean-Baptiste.
tomorrow i will check how the VLM one is...

sorry ... i searched the wiki so much for this and did not think to have a look on git as well.
probably too much of a hurry... :-)
mario

mcannistra
New Cone
New Cone
Posts: 4
Joined: 05 Nov 2013 15:22

Re: my 2 cents: an http (WebApi) wrapper for VLC's telnet

Postby mcannistra » 06 Nov 2013 17:55

Hi Jean-Baptiste.

I did some tests on my ubuntu setup of VLC.

In these few lines you can see what I am able to do from both the telnet and lua (terminal) interfaces:

vlm
new ch1 broadcast enabled loop
setup ch1 input "conc1.vob"
setup ch1 input "conc2.vob"
setup ch1 input "conc3.vob"
setup ch1 input "conc4.vob"
setup ch1 output #rtp{dst=MYdestinIPaddressHERE,port=5004,mux=ts,sap,name=test}
control ch1 play

i am able to create and edit the "playlist" removing clips, start and stop the stream.

MYdestinIPaddressHERE is the IP address of the destination laptop on which i open a network stream on vlc with rtp://@:5004/

I can also send the same commands through my http to telnet wrapper with same behavior.

Everything works fine until here.

Then I tried opening the VLC web UI with:

vlc -I http

and then used various commands in this way:

http://localhost:8080/requests/vlm_cmd.xml?command=new ch1 broadcast enabled loop
http://localhost:8080/requests/vlm_cmd.xml?command=setup ch1 input "conc1.vob"

and they worked fine

i got errors when I tried to config the output with method 1:
http://localhost:8080/requests/vlm_cmd.xml?command=setup ch1 output #std{access=rtp{ttl=255},mux=ts,dst=MYdestinIPaddressHERE:5004,sap,group="group1",name="chann1"}

that is, using the output statement built using the vlm UI (http://localhost:8080/vlm.html)
because i get a missing parameter error and i cannot figure out what is missing

i got errors also when I tried configuring the output with method 2:
http://localhost:8080/requests/vlm_cmd.xml?command=setup ch1 output #rtp{dst=MYdestinIPaddressHERE,port=5004,mux=ts,sap,name=test}

that is, using the same output statement that i have been able to use via telnet and lua (see above).

in addition to this, i have got errors also when trying to delete one of the inputs.

Probably I am still doing something wrong or, there is a different behavior between the web UI apis (http://localhost:8080/requests/ ) and the lua/telnet interfaces.

If you have suggestions I will be more than happy to try again.

Thank you for your time,
Mario


Return to “Contribute and help the VideoLAN project”

Who is online

Users browsing this forum: No registered users and 12 guests