我在 cpp 中有一个 opencv 应用程序。
它使用 opencv 的简单结构捕获视频流并将其保存到视频文件中。
它与我的网络摄像头完美配合。
但是,当我运行它从 IP 摄像机捕获流时,它可能会在大约十秒后崩溃。
我的编译命令是:
g++ -O3 IP_Camera_linux.cpp -o IP_Camera `pkg-config --cflags --libs opencv`
我的网络摄像机流的访问方式如下:
const string Stream = "rtsp://admin:[email protected] /cdn-cgi/l/email-protection/";
它确实运行完美,显示视频并保存它,直到显示的视频冻结并且应用程序崩溃。而终端上的错误消息是:
[h264 @ 0x15e6f60] error while decoding MB 59 31, bytestream (-20)
[h264 @ 0x15e8200] error while decoding MB 61 27, bytestream (-3)
[h264 @ 0x109c880] missing picture in access unit
[h264 @ 0x109c000] no frame!
据我了解,上述错误消息中的前两行可能有一些事情要做,但实际上并不会导致应用程序崩溃。最后两行大概是原因还是原因?
有什么帮助吗?
经过大量的点击和尝试后得到了解决方案。只需更改一下流地址就可以了。
From:
const string Stream = "rtsp://admin:[email protected] /cdn-cgi/l/email-protection/";
To:
const string Stream = "rtsp://admin:[email protected] /cdn-cgi/l/email-protection/ch1-s1?tcp";
不知道,它做了什么改变?
但它工作完美!
甚至还有以下形式的普遍警告:
[h264 @ 0x15e6f60] error while decoding MB 59 31, bytestream (-20)
[h264 @ 0x15e8200] error while decoding MB 61 27, bytestream (-3)
消失了。
无论如何,如果有人能解释其背后的逻辑原因,我将不胜感激。
CREDIT http://workingwithcomputervision.blogspot.com/2012/07/weve-finally-got-it-going-ill-get-onto.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)