parent
fe9bd62177
commit
a1ee1b9e8c
@ -0,0 +1,24 @@
|
||||
import cv2
|
||||
import numpy as np
|
||||
import os
|
||||
|
||||
os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"]="rtsp_transport;tcp"
|
||||
|
||||
gstreamerstr = "tcpclientsrc host=192.168.0.144 port=5000 ! jpegdec ! videoconvert ! appsink"
|
||||
|
||||
|
||||
|
||||
#if not capture.isOpened() : print("CANNOT OPEN STREAM")
|
||||
|
||||
while(True):
|
||||
capture = cv2.VideoCapture(gstreamerstr,cv2.CAP_GSTREAMER)
|
||||
ret, frame = capture.read()
|
||||
if not ret:
|
||||
print('fail')
|
||||
break
|
||||
cv2.imshow('frame',frame)
|
||||
cv2.waitKey(1)
|
||||
|
||||
|
||||
capture.release()
|
||||
cv2.destroyAllWindows()
|
Loading…
Reference in new issue