We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Processing to remote VLC
Page Index Toggle Pages: 1
Processing to remote VLC (Read 2191 times)
Processing to remote VLC
Apr 8th, 2009, 12:08pm
 
Hello to everybody
this is my goal (it's an easy one I think, but I can't solve it).

I have a PC1 (Fedora 10)  with VNC running and I want to remote (play, stop) it by Processing running on another PC2 (Fedora 10, controlling an arduino board for other purposes).

I've chosen to use vlc's rc interface because I don't need streaming or other fine controls that telnet or http could give me.

So I have this vlc on ip 192.168.0.22:4212 running on PC1, if I simply telnet 192.168.0.22:4212 on PC2, I can give commands to play and stop.

Now, the sketch I'm using is a modified medley:

import processing.net.*;

Client client;

void setup()
{
size(200, 200);
noStroke();
// Open a TCP socket to the host:
client = new Client(this, "192.168.0.22", 4212);
}

void draw()
{
while (client.available() > 0) {
println(client.ip());
background(0);
int in = client.read();
print((char)in);
client.write("stop" +"/n/n");
  }
}

I don't know if the syntax of the "stop" command is right or not (in telnet if I type stop it works), but it looks it doesn't even find the client available (the background it's not black).
Does anybody know how to play a simple telnet connection in processing?

Thankyou
Re: Processing to remote VLC
Reply #1 - Jun 21st, 2009, 9:04am
 
hi!

i'm currently working on it too. this is exactly what i want to do.

did you find a solution yet? could you please post it? i'm stuck and in a hurry.. Undecided

thanks in advance,
chris
Re: Processing to remote VLC
Reply #2 - Jun 22nd, 2009, 4:56am
 
Hi,

the escape sequence for newline is \n not /n

i just started vlc using this command

vlc video.avi  --intf rc --rc-host localhost:1234


now i can play the video using the left mousebutton
and stop it using the right mouse button

import processing.net.*;
Client client;

void setup(){
 size(200, 200);
 noStroke();
 client = new Client(this, "localhost", 1234);
}

void mousePressed() {
 if (mouseButton == RIGHT) {
   client.write("stop" +"\r\n");

 } else {
   client.write("play" +"\r\n");
 }
}

void draw() {
}


hope that helps,
guru
Re: Processing to remote VLC
Reply #3 - Jun 22nd, 2009, 6:14am
 
hi guru,

yes, it helped a lot for basic understanding!

thank you so much! Smiley

best regards,
chris
Re: Processing to remote VLC
Reply #4 - Jun 23rd, 2009, 7:29am
 
thats interesting
Page Index Toggle Pages: 1