Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/336.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python OpenCV内存泄漏_Python_Opencv_Memory_Gstreamer - Fatal编程技术网

Python OpenCV内存泄漏

Python OpenCV内存泄漏,python,opencv,memory,gstreamer,Python,Opencv,Memory,Gstreamer,每次执行代码后,都会泄漏150MB内存 cam = cv2.VideoCapture('rtsp://admin:admin@192.168.0.64:554/Streaming/Channels/101') ret_val, img = cam.read() ret_val = cv2.imwrite(str(chat_id) + '.jpg',img) cam.release() cv2.destroyAllWindows() 这很可能是由于OpenCV。下面是OpenCV的配置。 我正在

每次执行代码后,都会泄漏150MB内存

cam = cv2.VideoCapture('rtsp://admin:admin@192.168.0.64:554/Streaming/Channels/101')
ret_val, img = cam.read()
ret_val = cv2.imwrite(str(chat_id) + '.jpg',img)
cam.release()
cv2.destroyAllWindows()
这很可能是由于OpenCV。下面是OpenCV的配置。 我正在使用GStreamer,来处理来自IP摄像机的H264流

General configuration for OpenCV 3.4.1-dev =====================================
  Version control:               3.4.1-54-g5b868cc

  Platform:
    Timestamp:                   2018-03-11T16:10:52Z
    Host:                        Linux 4.13.0-36-generic x86_64
    CMake:                       3.5.1

  Video I/O:
    DC1394:                      YES (ver 2.2.4)
    FFMPEG:                      NO
      avcodec:                   NO
      avformat:                  NO
      avutil:                    NO
      swscale:                   NO
      avresample:                NO
    GStreamer:                   
      base:                      YES (ver 1.8.3)
      video:                     YES (ver 1.8.3)
      app:                       YES (ver 1.8.3)
      riff:                      YES (ver 1.8.3)
      pbutils:                   YES (ver 1.8.3)
    libv4l/libv4l2:              NO
    v4l/v4l2:                    linux/videodev2.h
    gPhoto2:                     NO