I’m using this pipeline for streaming processed frames:
pipeline = Gst.parse_launch(‘appsrc name=m_appsrc ! capsfilter name=m_capsfilter ! videoconvert ! x264enc ! rtph264pay ! udpsink name=m_udpsink’)
i can capture frames with appsink
cap = cv2.VideoCapture(
‘udpsrc port=5004 caps = “application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264”’
’ ! rtph264depay’
’ ! avdec_h264’
’ ! videoconvert’
’ ! appsink’, cv2.CAP_GSTREAMER)
But i want to recieve frame on NVR and i want to know url for connection.
When I try to connect by url rtsp://127.0.0.1:5004
with opencv:
cap = cv2.VideoCapture(‘rtsp://127.0.0.1:5004’)
I get error:
[tcp @ 0x2f0cf80] Connection to tcp://127.0.0.1:5004?timeout=0 failed: Connection refused
How can I find the url to connect to the stream?
Thank you in advance!
UPD: I'm trying to send and recieve frames on the same Jetson Nano, but in different docker containers (run with flag --net=host
).
I found example for rtsp streaming, added 276-283 lines to my code and run pipeline without errors. In second container I run this script:
cap = cv2.VideoCapture('rtsp://localhost:8554/ds-test', cv2.CAP_FFMPEG)
if cap.isOpened():
print('opened')
But video is not opening.