每次执行代码后,150 MB内存都会泄漏。
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