jloyd / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

How to get a image or stream from ip cameras ? #71

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Why can't I connect to ip cameras? I tried to use cvLoadImage too.

Follow my code:

---

import com.googlecode.javacv.*;
import static com.googlecode.javacv.cpp.opencv_core.*;

public class IpCam {

    public static void main(String[] args) throws Exception {

        OpenCVFrameGrabber grabber = new OpenCVFrameGrabber("http://192.168.0.180:8080/shot.jpg"); grabber.start();
        IplImage frame = grabber.grab();
        CanvasFrame canvasFrame = new CanvasFrame("Camera");
        canvasFrame.setCanvasSize(frame.width(), frame.height());
        while (canvasFrame.isVisible() && (frame = grabber.grab()) != null) {
            canvasFrame.showImage(frame);
        }
        grabber.stop();
        canvasFrame.dispose();
        System.exit(0);

    }
}

--

Thanks

Original issue reported on code.google.com by francisc...@gmail.com on 18 May 2011 at 1:16

GoogleCodeExporter commented 9 years ago
You mean like MJPEG? OpenCV may work, but you're better off with 
FFmpegFrameGrabber:
    FrameGrabber grabber = new FFmpegFrameGrabber("http://192.168.0.180:8080/shot.jpg");
    grabber.setFormat("mjpeg");
    grabber.start();
should work.

Original comment by samuel.a...@gmail.com on 18 May 2011 at 1:22

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
IP Webcam does stream in MJPEG, so just use FFmpegFrameGrabber

Original comment by samuel.a...@gmail.com on 19 May 2011 at 2:11

GoogleCodeExporter commented 9 years ago
Hi,

I have same like you. You found how resolve this problem ?

Original comment by mijoCh...@gmail.com on 14 Jan 2013 at 5:29