2

Summary:

I'm trying to get video from IP camera in emgu, I could display video in the browser from an ip like "http://169.254.255.253".

Question:

How could I display this from emgu?

mostafa8026
  • 273
  • 2
  • 12
  • 25
  • i just know that using httpWebRequest is the good way to get jpeg stream image from my panasonic ccty camera, but in motionJpegStream , how can i get video, because the content type of the motion jpeg is multiPart!!!! – mostafa8026 Apr 13 '12 at 20:36
  • What is your OS? Do you see this camera on your Operating System's Device Manager? I mean, can you access that directly from OS? – Kerberos Apr 13 '12 at 21:31
  • i'm using windows 7, yes I see it on my os using this link: http://192.168.1.253/nphMotionJpeg?Resolution=320x240&Quality=Standard – mostafa8026 Apr 14 '12 at 05:42
  • OK, see this post: http://www.emgu.com/forum/viewtopic.php?f=7&t=3095#p6615 You can get your system cameras list with DriectShow dll. If access ip camera with using DirectShow, may be, you can define your ip camera to capture object. – Kerberos Apr 14 '12 at 08:45

3 Answers3

3

If you are using Emgu 3.1 then try this:

Capture cameraCapture
cameraCapture = new Capture("http://user:passwd@http://169.254.255.253");
Mat frame = cameraCapture.QueryFrame();
imageBox1.Image = frame;

here is the Capture Class Reference:

http://www.emgu.com/wiki/files/3.1.0/document/html/5edc4ff8-cec3-c5ee-8e62-629cf4c7940a.htm

Hope it helps.

fins
  • 97
  • 1
  • 11
2
Capture _Capture = new Emgu.CV.CvInvoke.cvCreateFileCapture("http://username:pass@cam_address/axis-cgi/mjpg/video.cgi?resolution=640x480&req_fps=30&.mjpg");

I didn't test but may be this code snippet or approach can help you. For OpenCV example you can examine this page: OpenCV with Network Cameras

And you can examine this method's wiki page: http://www.emgu.com/wiki/files/2.3.0/document/html/a26a5e9d-53d7-633a-5d50-508aa22dd1fd.htm

Community
  • 1
  • 1
Kerberos
  • 1,228
  • 6
  • 24
  • 48
  • 1
    thank you, but your code doesn't work properly, cvCreateFileCapture return IntPtr. so i use that like : IntPtr i = Emgu.CV.CvInvoke.cvCreateFileCapture("http://192.168.1.253/nphMotionJpeg?Resolution=320x240&Quality=Standard"); but I don't know how to get video from url?!! – mostafa8026 Apr 14 '12 at 06:37
  • OK, Normally capture object can get int param. Int param means is index of camera on your system. For example if you use like this "Capture _Capture = New Capture(0);" you define your system camera which index number is zero. See this page for more detail: http://www.emgu.com/wiki/files/2.3.0/document/html/0f3099f2-d381-4319-6b31-6c289fb1e744.htm – Kerberos Apr 14 '12 at 08:38
0

via rstp protocol you can get the video feed

grabber = new Capture(@"rtsp://UserName:Password@172.198.8.44:654/Streaming/Channels/101") 
grabber.QueryFrame();

this is for Hikvision camera

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103