[英]600 Milliseconds delay in EmguCv real-time video Decoding
I am developing a real-time computer vision application using C#. 我正在使用C#开发实时计算机视觉应用程序。 But I am not able to optimize Emgucv decoding.
但是我无法优化Emgucv解码。 I have 800-millisecond delay from the ground truth and 600-millisecond delay from the Ip camera provider application AXIS.
我离地面真相有800毫秒的延迟,而Ip摄像机提供商应用程序AXIS则有600毫秒的延迟。
How can I optimize the code that I can have at-most 250-milliseconds delay? 如何优化最多延迟250毫秒的代码?
Here is code for grabbing an image. 这是获取图像的代码。
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: 我的应用程序的秒表结果与相机提供者应用程序的比较:
The above-mentioned problem has been solved using one of the real-time RTSP stream capturing library named as LIVE555. 使用名为LIVE555的实时RTSP流捕获库之一已解决了上述问题。 I have used it in C++ and shared the memory of images with C#.
我在C ++中使用了它,并与C#共享了图像的内存。 The delay is reduced up to round about 200 milliseconds only.
延迟最多可减少到大约200毫秒。 If anyone wants real-time video streaming then LIVE555 is the best.
如果有人想要实时视频流,那么LIVE555是最好的。 I will upload the project to my Github.
我会将项目上传到我的Github。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.