1

IP カメラからフレームを取得しようとしています。Ubuntu 14.04 PC やRaspberry Piから FFMPEG または GStreamer を使用してフレームを取得できますomxplayergst-launch-1.0しかし、Raspberry Pi から c++ OpenCV を使用してカメラにアクセスしようとすると、GStreamer パイプラインに関するエラーが表示されます。

(ocvip:2870): GStreamer-WARNING **: Failed to load plugin '/usr/local/lib/gstreamer-1.0/libgstrtsp.so': /usr/local/lib/gstreamer-1.0/libgstrtsp.so: undefined symbol: gst_rtsp_connection_set_tls_validation_flags
GStreamer Plugin: Embedded video playback halted; module u-uridecodebin, reported: URI was not accepted by any element
OpenCV Error: Unspecified error (GStreamer: unable to start pipeline) in icvStartPipeline, file /opt/opencv-2.4.10/modules/highgui/src/cap_gstreamer.cpp, line 383
what(): /opt/opencv-2.4.10/modules/highgui/src/cap_gstreamer.cpp:383: error: (-2) GStreamer unable to start pipeline in function icvStartPipeline

Aborted

コード:

const string videoAddress = "rtsp://user:password@xxx.xxx.x.xxx:xxx/cam/realmonitor?channel=1&subtype=1";
int main() {
  cv::VideoCapture video;
  cv::Mat im;
  cv::namedWindow("IP", 1);
  video.open(videoAddress);
  if (video.isOpened()) {
    video >> im;
    if (!im.data) break;
    cv::imshow("IP", im);
    if (cv::waitKey(20) >= 0) break;
  }
}

同じ rtsp アドレスでカメラにアクセスできます。omxplayer では通常の gst-launch が表示され、180 度回転したフレームが表示されます。ビルド済みのライブラリが cmake で見つからないため、このページを使用して GStreamer-1.0 をビルドしました。この問題を見つけました。このバグには2つの修正がありますが、カメラにアクセスしていないため、これらが正しい解決策であり、問​​題を解決できるかどうかvideo.open(0)はわかりません。video.open(IPAddress + CV_CAP_PVAPI)

ありがとう。

4

0 に答える 0