简体   繁体   English

EmguCV捕获rtsp ip摄像机流ffmpeg

[英]EmguCV capture rtsp ip camera stream ffmpeg

I am working with IP camera and EmguCV to detect person in an area. 我正在使用IP摄像机和EmguCV来检测区域中的人。 Everything is work normally with Highgui capture source. Highgui捕获源一切正常。 But with Arlo camera which use FFMPEG format, I am unable to get stream without any exception. 但是对于使用FFMPEG格式的Arlo相机,我无一例外都无法获取视频流。 Here is the code I have tried: 这是我尝试过的代码:

if (capture == null)
        {
            try
            {
                capture = new Capture("rtsp://<IP>:8554/live"); 
                capture.ImageGrabbed += Capture_ImageGrabbed;
                capture.Grab();
                capture.Start();
            }


            catch (NullReferenceException exception)
            {
                MessageBox.Show(exception.Message);
            }
            catch (TypeInitializationException exc)
            {
                MessageBox.Show(
                   "Attention: You have to copy all the assemblies and native libraries from an official release of EmguCV to the directory of the demo." +
                   Environment.NewLine + Environment.NewLine + exc);
            }
}

and here is Capture_ImageGrabbed event which is not fired. 这是没有触发的Capture_ImageGrabbed事件。

private void Capture_ImageGrabbed(object sender, EventArgs e)
    {
        Mat image = new Mat();
        capture.Retrieve(image);
        picCAM.Image = image.Bitmap;
    }

Thanks so much for your help! 非常感谢你的帮助!

This might be old, but until now I'm also facing the same issue, even using the newest version (which is version 3.3). 这可能很旧,但是直到现在,即使使用最新版本(3.3版),我也面临着同样的问题。 Probably not the best solution, but after took some trial and error, what I did is to downgrade to version 2.4.2. 可能不是最好的解决方案,但是经过反复试验,我要做的是降级到2.4.2版。 You can download here . 您可以在此处下载。

I also recently submitted this issue in github . 我最近也在github中提交了此问题。 This is probably a bug. 这可能是一个错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM