【问题标题】:Cant get RTSP stream - nonmatching无法获取 RTSP 流 - 不匹配
【发布时间】:2016-10-24 23:23:08
【问题描述】:

我正在使用 Raspberry Pi3,我试图通过我的无线 IP 摄像头获取 RTSP 流,但我收到此错误:

pi@raspberrypi:~ $ alprd -f
INFO - Running OpenALPR daemon in the foreground.
INFO - Using: /etc/openalpr/alprd.conf for daemon configuration
Missing config value for company_id
Missing config value for pattern
INFO - Using: /home/pi/Database/pictures for storing valid plate images
INFO - country: br -- config file: /etc/openalpr/openalpr.conf
INFO - pattern: 
INFO - Stream 1: rtsp://192.168.1.230:554/onvif1
INFO - Starting camera 1
INFO - Video stream connecting...
[rtsp @ 0x71700960] Nonmatching transport in server reply
WARN - Stream rtsp://192.168.1.230:554/onvif1 failed to open.
INFO - Video stream connecting...
[rtsp @ 0x71700840] Nonmatching transport in server reply
WARN - Stream rtsp://192.168.1.230:554/onvif1 failed to open.
INFO - Video stream connecting...
[rtsp @ 0x71700960] Nonmatching transport in server reply
WARN - Stream rtsp://192.168.1.230:554/onvif1 failed to open.
INFO - Video stream connecting...
[rtsp @ 0x71700840] Nonmatching transport in server reply
WARN - Stream rtsp://192.168.1.230:554/onvif1 failed to open.
INFO - Video stream connecting...
[rtsp @ 0x71700960] Nonmatching transport in server reply
WARN - Stream rtsp://192.168.1.230:554/onvif1 failed to open.
INFO - Video stream connecting...
[rtsp @ 0x71700840] Nonmatching transport in server reply
WARN - Stream rtsp://192.168.1.230:554/onvif1 failed to open.

我正在使用的 RTSP 链接是: rtsp://192.168.1.230:554/onvif1

或与用户:pwd 是:

rtsp://2512398:123@192.168.1.230:554/onvif1

在我的 alprd.conf 中是这样的:

; Declare each stream on a separate line
; each unique stream should be defined as stream = [url]

stream = rtsp://192.168.1.230:554/onvif1
;stream = http://192.168.1.36:8080/video
;stream = http://127.0.0.1/example_second_stream.mjpeg
;stream = webcam

我可以毫无问题地使用 VLC(在我的计算机和 RPI 中)进行连接,但是当我在 .conf 文件中使用它以使用命令 alprd -f 开始检查许可证时盘子我得到那个错误:/

我真的是一个编程新手,所以请不要说得太具体,因为我可能不会理解它哈哈哈

谢谢各位!爱你们所有人

【问题讨论】:

    标签: opencv stream video-streaming rtsp openalpr


    【解决方案1】:

    我遇到了类似的问题,尝试ffplay -rtsp_transport tcp rtsp//:...,如果您遇到同样的错误,您需要更改opencv ffmpeg_cap_impl.hpp 源,因为这个参数是硬编码的。

    【讨论】:

      【解决方案2】:

      OpenCV 3.4.1 中,您可以将环境变量 OPENCV_FFMPEG_CAPTURE_OPTIONS 更改为“rtsp_transport;0”。

      在 cap_ffmpeg_impl.hpp 中考虑了这个 env var。

      #if USE_AV_INTERRUPT_CALLBACK
          /* interrupt callback */
          interrupt_metadata.timeout_after_ms = LIBAVFORMAT_INTERRUPT_OPEN_TIMEOUT_MS;
          get_monotonic_time(&interrupt_metadata.value);
      
          ic = avformat_alloc_context();
          ic->interrupt_callback.callback = _opencv_ffmpeg_interrupt_callback;
          ic->interrupt_callback.opaque = &interrupt_metadata;
      #endif
      
      #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0)
      #ifndef NO_GETENV
          char* options = getenv("OPENCV_FFMPEG_CAPTURE_OPTIONS");
          if(options == NULL)
          {
              av_dict_set(&dict, "rtsp_transport", "tcp", 0);
          }
          else
          {
      #if LIBAVUTIL_BUILD >= (LIBAVUTIL_VERSION_MICRO >= 100 ? CALC_FFMPEG_VERSION(52, 17, 100) : CALC_FFMPEG_VERSION(52, 7, 0))
              av_dict_parse_string(&dict, options, ";", "|", 0);
      #else
              av_dict_set(&dict, "rtsp_transport", "tcp", 0);
      #endif
          }
      #else
          av_dict_set(&dict, "rtsp_transport", "tcp", 0);
      #endif
          int err = avformat_open_input(&ic, _filename, NULL, &dict);
      #else
          int err = av_open_input_file(&ic, _filename, NULL, 0, NULL);
      #endif
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-10-18
        • 2011-12-17
        • 1970-01-01
        • 2017-09-30
        • 1970-01-01
        • 2012-09-11
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多