import cv2
# rtsp://admin:tensorsight666@192.168.8.129:554/h265/ch1/main/av_stream
pipeline = "rtspsrc location=\"rtsp://admin:tensorsight666@192.168.8.129:554/\" ! rtph264depay ! h264parse ! omxh264dec ! nvvidconv ! video/x-raw, format=(string)BGRx! videoconvert ! appsink"
# pipeline = "rtsp://admin:tensorsight666@192.168.8.129:554/h265/ch1/main/av_stream"
capture = cv2.VideoCapture(pipeline, cv2.CAP_GSTREAMER)
num = 0
while capture.isOpened():
res, frame = capture.read()
# cv2.imshow("Video", frame)
num += 1
key = cv2.waitKey(1) & 0xFF
if key == ord("q"):
break
print(num,'----------')
capture.release()
cv2.destroyAllWindows()
gstreamer 硬解码 Python
最新推荐文章于 2024-05-10 09:29:29 发布