2016-03-08 106 views
0

我想捕捉來自ip的視頻流。我已經看到了這一點,但類型名稱cvCreateFileCapture不存在於cvInvoke在Emgu 3.0有沒有什麼辦法可以從ip捕獲視頻?Emgu Capture中的IP攝像頭集成

我試過使用它,它沒有工作,但消息框顯示哪個意思是捕獲不爲空。 imageCamera是空

_capture = new Capture("http://uname:[email protected]/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; 

我在瀏覽器中輸入這個http://uname:[email protected]/axis-cgi/mjpg/video.cgi和視頻流是存在的。

我見過我見過this,但類型名稱cvCreateFileCapture不存在於cvInvoke中的Emgu 3.0有沒有什麼辦法可以從ip捕獲視頻?

嘗試輸入http://uname:[email protected]/axis-cgi/mjpg/video.cgi到VLC - >媒體 - >網絡流,它完美的作品。但是爲什麼我在捕獲時看不到它?

回答

0

Retrieve()需要你先使用Grab()。如果你只需要一個圖像,你也可以嘗試使用QueryFrame()。

var image = _capture.QueryFrame(); 
+0

我可以正確使用Retrieve()與文件中的視頻。問題在於設置來自IP攝像頭的採集。沒有得到一個圖像 – Untitled

+1

@Untitled可能是Opencv不理解.cgi鏈接。看看這個[post](http://answers.opencv.org/question/17210/d-link-ip-cam-read-stream-and-picture/),嘗試在URL後添加?x.mjpeg到url。 cgi –

+0

@AndersJørgensen加入「?x.mjpeg」工作。謝謝。 –