EmguCv实时视频解码延迟600毫秒

时间:2018-02-16 05:32:39

标签: c# opencv real-time picturebox emgucv

我正在使用C#开发实时计算机视觉应用程序。但我无法优化Emgucv解码。我从Ip相机提供商应用AXIS的基础事实和600毫秒延迟延迟了800毫秒。

如何优化我最多可以延迟250毫秒的代码?

这是抓取图像的代码。

capture1 = new Capture(IpFirstCamTxt.Text);     //create a camera captue from RTSP Stream
capture2 = new Capture(Ip2ndCamTxt.Text);
capture3 = new Capture(Ip3rdCamTxt.Text);
capture4 = new Capture(Ip4thCamTxt.Text);

capture1.Start();
capture2.Start();
capture3.Start();
capture4.Start();
capture1.ImageGrabbed += ProcessFrame1;
capture2.ImageGrabbed += ProcessFrame2;
capture3.ImageGrabbed += ProcessFrame3;
capture4.ImageGrabbed += ProcessFrame4;



private void ProcessFrame1(object sender, EventArgs arg)
{
    _capture.RetrieveBgrFrame().ToBitmap());
    capture1.Retrieve(img1, 3);
    pictureBox1.Image = img1.ToBitmap();
}
private void ProcessFrame2(object sender, EventArgs arg)
{
    capture2.Retrieve(img2, 3);
    pictureBox3.Image = img2.ToBitmap();

}
private void ProcessFrame3(object sender, EventArgs arg)
{
    capture3.Retrieve(img3, 3);
    pictureBox4.Image = img3.ToBitmap();
}
private void ProcessFrame4(object sender, EventArgs arg)
{
    capture4.Retrieve(img4, 3);
    pictureBox5.Image = img4.ToBitmap();
}

我的应用程序的秒表结果与相机提供商应用程序比较:   Stopwatch results of my application comparing with camera provider application

1 个答案:

答案 0 :(得分:0)

使用名为LIVE555的实时RTSP流捕获库之一已解决了上述问题。我在C ++中使用了它,并与C#共享了图像的内存。 延迟最多可减少到大约200毫秒。 如果有人想要实时视频流,那么LIVE555是最好的。 我会将项目上传到我的Github。

来源Real-time RTSP Stream Decoding

相关问题