Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to attach an analog camera to an old linux computer and directly pipe the /dev/video0 to another computer, where I can use it as a device again (so /dev/video0 should go to /dev/remote0, for example)

(Reason for doing this is that the computer does not have enough power to encode the video)

Is that possible? I've seen people can pipe the data directly from the device over ssh into mplayer, but I need to have some sort of reference point for Zoneminder.

  • Edit: As Phil Hannent said: SSH would probably also be too resource intensive for the hardware as it has to encrypt the data it sends. So is this also possible over a program like tcptunnel?

  • Edit2: On the Unix & Linux stackexchange site I found a question that uses this for piping over ssh: ssh localhost dd if=/dev/video0 | mplayer tv://device=/dev/stdin can that be done over tcptunnel?

share|improve this question
up vote 2 down vote accepted

You can use netcat.

cat /dev/video0 | nc -l 1234

This will open a server on one host listening on port 1234 and sending uncompressed and unencrypted data from /dev/video0 to any client that connects. You can receive the data on other host by invoking:

nc videohost 1234 | mplayer tv://device=/dev/stdin

where videohost is the host sending data from /dev/video0.

share|improve this answer
Nice! Is it possible to pipe the data into a /dev/file first, and then separately opening it in mplayer? – skerit Aug 12 '11 at 11:25
I think creating device would be too complicated, but if you need something file-like you could try a fifo pipe (mknod /tmp/videofifo p) write the stream to it and pipe it's contents to mplayer using cat. Not sure how the pipe would behave if you don't read the data from it though. – Paweł Nadolski Aug 12 '11 at 11:42
I'll give it a try tonight. Very interested to see how it'll turn out! – skerit Aug 12 '11 at 11:50
I'd also like to point out ipusb: it probably works even better than this. It lets you mount a usb device over the network. – skerit Sep 7 '11 at 21:51
"nc videohost 1234 | mplayer tv://device=/dev/stdin" output error "Playing tv://device=/dev/stdin. The filename option must be an integer: dev/stdin Struct tv, field filename parsing error: dev/stdin". I think this problem in my webcam or in my mplayer. "nc videohost 1234 | vlc - " work for me. – user3439968 Feb 22 at 20:24

I would seriously advise you against this. I recently tried streaming avi videos over an ssh:// file access and its painful. You have to remember that the video is being encrypted and then decrypted during this process.

If your computer cannot handle compressing the stream then it certainly will not be able to handle encrypting it.

Really you want to just have a tcp tunnel the raw data:

share|improve this answer
Right, I forgot about that. But how would you pipe device data over this? – skerit Aug 11 '11 at 9:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.