I'm looking to place a usb webcam in a remote room. The only nearby computer is a not so powerful HTPC. How might I access that webcam remotely from my main pc?

The HTPC is hooked up to a projector so anything that has to be setup/started would be done using remote desktop. Ideally it would not be cpu/mem intensive, I'm hoping for just some passthru usb-to-network setup.

I've tried using VLC however starting the stream using remote desktop doesn't seem to work and the transcoding takes about 30% cpu. Any suggestions?

  • Do you have an OS? – random Sep 4 '11 at 22:13

VLC example (for linux):

cvlc -vvv v4l2:// --sout '#transcode{vcodec=mjpg,vb=2000,width=320,height=240,venc=ffmpeg}:duplicate{dst=standard{access=http,mux=mpjpeg,dst=}'

Then point your non-IE browser to

You can use vlc to stream things other than mjpeg. If computer is slow you need to experiment with codec parameters. You can also use gstreamer (on linux).

ffmpeg example (for linux):

ffmpeg -f video4linux2  -i /dev/video0  -vcodec libx264 -vpre ultrafast -b 1000k -f matroska -y /dev/stdout | nc -lp 5555


nc 5555 | mplayer -cache 1024 -

Highly tweakable.

The same, but with socat and HTTP:

socat tcp-l:5555,fork,reuseaddr system:'printf "HTTP/1.0\\\\x20200\\\\x20OK\\\\r\\\\n\\\\r\\\\n" && ffmpeg -f video4linux2  -i /dev/video0  -vcodec libx264 -vpre ultrafast -b 1000k -f matroska pipe\:1'

More advanced version with sound here.

  • 2
    Please only post one answer to a question. You can always go back and edit your previous one too. – slhck Sep 4 '11 at 20:12
  • @slhck, Discussing this on meta. – Vi. Sep 4 '11 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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