Page 1 of 1

VLC remote control via TCP

Posted: 17 Mar 2013 20:11
by Challex
Hi,
i'm trying to remote control my vlc player over a tcp socket.
I enabled the Remote-Control-Interface (oldrc) and set the binding to localhost:2000 (with disabled console).
http://imgur.com/1grGMwr,xGOLa3x#0
http://imgur.com/1grGMwr,xGOLa3x#1

Now i wrote a small java application which establishs a connection to the bound port and sends a simple "pause\r\n" to vlc.

Code: Select all

s = new Socket("127.0.0.1",2000); oos = new ObjectOutputStream(s.getOutputStream()); oos.writeObject("pause\r\n"); oos.flush();


The application itself is a little bit bigger, because i build a GUI around.

Here is the Problem:
The establishment of the connections works fine, but the player itself does nothing. It's completely ignoring the command.
Nowhere i get any kind of errors or exceptions.
I also tried other commands, but there was no response too.

I use VLC 2.0.4 and a song played while testing the pause command.

Hope you can help me.

Re: VLC remote control via TCP

Posted: 20 Mar 2013 02:47
by huck
Have you looked at what vlc is sending you over the socket? I havent looked much at oldrc, but the new interfaces request a password before doing anything

Re: VLC remote control via TCP

Posted: 20 Mar 2013 14:56
by Challex
When i opened the InputStream the thread blocks =/

Code: Select all

inputStream = new ObjectInputStream(socket.getInputStream());

Re: VLC remote control via TCP

Posted: 20 Mar 2013 15:04
by huck
can you do non blocking IO? i think the prompt is "Password:" with no CR if its like the newest version.

Re: VLC remote control via TCP

Posted: 20 Mar 2013 17:36
by Challex
aahhh i got it :D

my problem was the ObjectOutputStream (also the ObjectInputStream). I changed it to BufferedWriter/Reader and now it works.
But thanks for your efforts.