Retrieve camera stream over network

I have a Raspberry Pi using Motion (basic Linux webcam / security cam package) broadcasting a webcam stream over port 8081.

I would assume I would use the Processing .net* library.

Motion basically makes jpg's and that is what is being sent, presumably. I can read them as strings in Processing. Of course this is a bunch of nonsense; and I don't know how to put that in a PImage.

I also thought I may be able to simply use img = loadImage("http://192.168.1.105:8081/", "jpg"); Although Processing is making contact (lights blinking on RPi's wifi), image(img, 0, 0); displays nothing, unfortunately.

What's the fastest / most efficient way to do this that actually works? :/

Thanks!

Answers

  • Answer ✓

    After a while of searching a reading, I eventually found out that Motion transmits using mjpeg, motion jpeg. Thankfully someone has already made a simple library for this, called ipcapture. https://code.google.com/p/ipcapture/

    It's a little old and never made its way into the current Processing library manager, but still easily added via manual installation. It seems to work well with some basic initial tests. Yay!

  • Hey joySeeing,

    I have seen other people reporting that IPCapture works, but I'm not having any luck. I've tried Processing 2 and 3 on a Mac, and keep getting this error:

    Unable to open I/O streams: Server returned HTTP response code: 401 for URL: http://192.168.0.14/videostream.cgi

    Did you have any troubles like this?

  • I'm not an expert on it. I can get it to work for Processing 2 and 3 but not with P3D (probably unrelated to your issue).

    In my setup, I have motion on a Linux box just sending jpgs on port 8081, so the address looks like http://192.168.1.105:8081/ I'm not sure what your setup is so I don't know what I can tell ya.

Sign In or Register to comment.