[PD] controlling a webcam?

Martin Peach martinrp at vax2.concordia.ca
Thu Sep 29 17:46:39 CEST 2005

julieta Maria wrote:

>Hi, list! I have a question:  I have to be able to
>control a the movement of web cam through internet. I
>was thinking to attach it to a couple of motors and
>control them through a serial port via a stamp... I
>would try to control the stamp sending values from PD
>(via the serial port)...

You could use a serial-to-servo controller like the minissc and skip the 
stamp part, to control two servos from a serial port. If your webcam is 
lightweight hobby servos work fine. Total cost < $150.

> And somehow send these values
>to PD from a web interface... Is this possible and/or
>the best/easier way to do it? Can I use the netreceive
>object for this, and what kind of objects/ software
>should I use to send this kind of data over the
>internet, what info would I need for that? I am
>practically new to networking...
You would need to write a script on the web host in php or javascript or 
perl or whatever that takes input from a web page and translates it to 
serial data for the servo controller. You don't need pd for this at all.

Another approach is to run a pd patch instead of a web browser, that 
talks over the net to a script/program on the camera machine. A 
standalone programs included with pd called pdreceive can be used to 
interface other programs/scripts with pd's netsend object. Programming 
in c you could start with u_pdreceive.c to make a program to accept 
specific commands from a pdsend object in a remote pd patch and 
communicate with the servo controller ... otherwise have pdreceive pipe 
to a script/program that does the command parsing and serial port bit. 
Or you could use pd at both ends of the connection, but there is no 
serial object for non-unix pd it seems.


More information about the Pd-list mailing list