I'm having trouble connecting via udp gstreamer python. When I enter the command gst-launch-1.0 -v udpsrc port=3000 buffer-size=13000000 ! h264parse ! avdec_h264 ! d3dvideosink sync=false
. Everything works, but when I try to connect via python "Could not open video"
import sys
import cv2
cap = cv2.VideoCapture("udpsrc port=3000 ! application/x-rtp,payload=96,encoding-name=H264 ! rtpjitterbuffer mode=1 ! rtph264depay ! h264parse ! decodebin ! videoconvert ! appsink", cv2.CAP_GSTREAMER);
if not cap.isOpened():
print("Could not open video")
sys.exit()
# Read first frame.
ok, frame = cap.read()
if not ok:
print('Cannot read video file')
sys.exit()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…