tags:

views:

246

answers:

5

I had an idea, but don't know if it could be possible to do :

Could it be possible to code a usb cam driver who can multiplex a video source to any software that needs it ? a sort of "man in the middle" driver :)

+1  A: 

Yes. As for how that is system dependent. You don't even say what OS you're talking about. At any rate both windows and linux support drivers that call other drivers.

SpliFF
I though about windows, but it could be interesting for any os..
Armageddon
A: 

Hrm, if it's GNU/Linux, MacOS or any other supported OS it might be possible to multiplex the device node with a simple enough FUSE module... If there are no responses along this line by tomorrow I'll try knocking up a little Perl (if I can find my cam...) :)

I thought about coding something like this (as a kernel module) some time ago but it ended up on the back burner - the idea was actually for webcams but could have be applied to provide a multiplexed, read-only device node abstracting any other device node providing a stream of data...

John Barrett
+1  A: 

If you need a Linux driver, look at the v4l loopback driver:

http://www.lavrsen.dk/foswiki/bin/view/Motion/VideoFourLinuxLoopbackDevice

It should be possible to combine that with some userland code to do what you want.

For Windows, you can probably do something in user space using DirectShow.

Ori Pessach
That's great ! thanks !Why should I want to reinvent the wheel ? :)
Armageddon
If someone knows something similar under windows..
Armageddon
A: 

May want to look at a FTDI chip http://www.ftdichip.com/

Has a driver available for many OS's.

Also could look at the Arduino board that already has a USB chip on it. http://www.arduino.cc/.

Maestro1024
I think the OP was looking for info on Webcam feed redirection on a PC at a software level, esp. considering the best answer chosen. A hardware level solution for what he is trying to do is excessive and unecessary, unless the OP wanted to make a webcam server of sorts.
sheepsimulator
+1  A: 

This should be possible in the Windows driver model too. It's called an "upper level filter driver", and sits between the regular driver and userspace.

The underlying driver is apparently is exclusive, while your filter should not be. It may be wise then to read this blogpost on how to make drivers (non)exclusive.

MSalters