• <legend id='V4tJ9'><style id='V4tJ9'><dir id='V4tJ9'><q id='V4tJ9'></q></dir></style></legend>

    <small id='V4tJ9'></small><noframes id='V4tJ9'>

      <i id='V4tJ9'><tr id='V4tJ9'><dt id='V4tJ9'><q id='V4tJ9'><span id='V4tJ9'><b id='V4tJ9'><form id='V4tJ9'><ins id='V4tJ9'></ins><ul id='V4tJ9'></ul><sub id='V4tJ9'></sub></form><legend id='V4tJ9'></legend><bdo id='V4tJ9'><pre id='V4tJ9'><center id='V4tJ9'></center></pre></bdo></b><th id='V4tJ9'></th></span></q></dt></tr></i><div id='V4tJ9'><tfoot id='V4tJ9'></tfoot><dl id='V4tJ9'><fieldset id='V4tJ9'></fieldset></dl></div>

        • <bdo id='V4tJ9'></bdo><ul id='V4tJ9'></ul>

      1. <tfoot id='V4tJ9'></tfoot>
      2. OpenCV - 如何捕获 rtsp 视频流

        时间:2024-08-13
            <tbody id='ed5Ez'></tbody>
          <i id='ed5Ez'><tr id='ed5Ez'><dt id='ed5Ez'><q id='ed5Ez'><span id='ed5Ez'><b id='ed5Ez'><form id='ed5Ez'><ins id='ed5Ez'></ins><ul id='ed5Ez'></ul><sub id='ed5Ez'></sub></form><legend id='ed5Ez'></legend><bdo id='ed5Ez'><pre id='ed5Ez'><center id='ed5Ez'></center></pre></bdo></b><th id='ed5Ez'></th></span></q></dt></tr></i><div id='ed5Ez'><tfoot id='ed5Ez'></tfoot><dl id='ed5Ez'><fieldset id='ed5Ez'></fieldset></dl></div>

          <small id='ed5Ez'></small><noframes id='ed5Ez'>

            <bdo id='ed5Ez'></bdo><ul id='ed5Ez'></ul>

              <legend id='ed5Ez'><style id='ed5Ez'><dir id='ed5Ez'><q id='ed5Ez'></q></dir></style></legend>

              • <tfoot id='ed5Ez'></tfoot>
                  本文介绍了OpenCV - 如何捕获 rtsp 视频流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  例如,我们有工作 rtsp 流测试,如:rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov"(它在发布这篇文章时起作用)

                  for example we have working rtsp stream test like: "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov" (it works in moment of publishing this post)

                  现在我想在 openCV (opencv 2.4.7/2.4.8) 中捕捉这个视频流我的代码在本地电影文件上运行良好,但是当我尝试捕获 rtsp 时,我收到如下消息:无法读取电影文件 rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov"

                  Now I want to catch this video stream in openCV (opencv 2.4.7 / 2.4.8) I've my code works perfectly on local movie files but when I try to capture rtsp I get msgs like: "Couldn't read movie file rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov"

                  我尝试了几种不同的方法,例如:

                  I've tried few different ways like:

                  CvCapture *camera = cvCreateFileCapture("rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov"); 
                  if (camera == NULL) {
                   printf("video is null, aborting...");
                   return -1;
                  }
                  else{ 
                   printf("video ok");
                  }
                  

                  或:

                  cv::VideoCapture vcap;
                  //open the video stream and make sure it's opened
                  if(!vcap.open("rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov")) {
                      std::cout << "Error opening video stream or file" << std::endl;
                      return -1;
                  }
                  

                  有什么想法吗?

                  --

                  尼德维德

                  推荐答案

                  以下代码对我来说没有任何问题.如果您有流的用户名和密码,请不要忘记将其包含在 url 地址中.

                  The following code works for me without any problem. If you have a username and password for the stream, do not forget to include it in the url address.

                  cv::VideoCapture capture(url);
                  
                  if (!capture->isOpened()) {
                      //Error
                  }
                  
                  cv::namedWindow("TEST", CV_WINDOW_AUTOSIZE);
                  
                  cv::Mat frame;
                  
                  while(m_enable) {
                      if (!capture->read(frame)) {
                          //Error
                      }
                      cv::imshow("TEST", frame);
                  
                      cv::waitKey(30);
                  }
                  

                  这篇关于OpenCV - 如何捕获 rtsp 视频流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:c++ - 从C++中的istream对象读取时如何检测空行? 下一篇:Boost Spirit可以用来解析字节流数据吗?

                  相关文章

                • <small id='ataI6'></small><noframes id='ataI6'>

                • <i id='ataI6'><tr id='ataI6'><dt id='ataI6'><q id='ataI6'><span id='ataI6'><b id='ataI6'><form id='ataI6'><ins id='ataI6'></ins><ul id='ataI6'></ul><sub id='ataI6'></sub></form><legend id='ataI6'></legend><bdo id='ataI6'><pre id='ataI6'><center id='ataI6'></center></pre></bdo></b><th id='ataI6'></th></span></q></dt></tr></i><div id='ataI6'><tfoot id='ataI6'></tfoot><dl id='ataI6'><fieldset id='ataI6'></fieldset></dl></div>
                      <bdo id='ataI6'></bdo><ul id='ataI6'></ul>

                    1. <legend id='ataI6'><style id='ataI6'><dir id='ataI6'><q id='ataI6'></q></dir></style></legend>
                    2. <tfoot id='ataI6'></tfoot>