0

I want to capture video stream from an ip. I've seen this but the type name cvCreateFileCapture does not exist on cvInvoke in Emgu 3.0 is there any way I can capture video from an ip?

I've tried using this, it didn't work but the message box shows which means capture is not null. imageCamera is empty

 _capture = new Capture("http://uname:pass@10.16.33.158/axis-cgi/mjpg/video.cgi");here
 if (_capture != null) //if camera capture has been successfully created
        {
            MessageBox.Show("Capture success");
            _capture.ImageGrabbed += ProcessFrame;
            _capture.Start();
        }

 _capture.Retrieve(frame, 0);
 Image<Bgra, Byte> newFrame = new Image<Bgra, Byte>(frame.Bitmap);
 imageCamera.Image = newFrame;

I entered this http://uname:pass@10.16.33.158/axis-cgi/mjpg/video.cgi in my browser and the video stream is there.

I've seen I've seen this but the type name cvCreateFileCapture does not exist on cvInvoke in Emgu 3.0 is there any way I can capture video from an ip?

Tried entering http://uname:pass@10.16.33.158/axis-cgi/mjpg/video.cgi into VLC -> Media -> Network stream, it works perfectly. But why I can't see it on my capture?

Community
  • 1
  • 1
Untitled
  • 115
  • 2
  • 13

1 Answers1

0

Retrieve() requires you to use Grab() first. You can also try using QueryFrame() instead if you just need the one image.

var image = _capture.QueryFrame();
Anders
  • 580
  • 5
  • 19
  • I can use the Retrieve() properly with a video from a file. The problem is setting the capture from a IP Camera feed. Not getting an image – Untitled Mar 10 '16 at 05:44
  • 1
    @Untitled might be that Opencv don't understand the .cgi link. Looking at this [post](http://answers.opencv.org/question/17210/d-link-ip-cam-read-stream-and-picture/), try add ?x.mjpeg to the url after .cgi – Anders Mar 12 '16 at 08:23