“Nonmatching transport in server reply” when cv2.VideoCapture rtsp onvif camera, how to fix?

前端 未结 4 1793
滥情空心
滥情空心 2021-01-06 15:17

I\'m on windows 10 using python 3.6.4, installed opencv (3.4) through pip. Here\'s the code I\'m using:

import numpy as np
import cv2
cap = cv2.VideoCapture(         


        
4条回答
  •  离开以前
    2021-01-06 15:51

    As mentionned, I tried to put in the python code the following:

    import os
      os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "rtsp_transport;0"
    

    or

    import os
      os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "rtsp_transport;udp"
    

    or

    import os
      os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "dummy"
    

    unfortunately none was working as I was still running my program in the same cmd window.

    I simply opened a new cmd window and gave a try for a new run... and it works (with "rtsp_transport;0" :)

提交回复
热议问题