diff --git a/gstreamer.txt b/gstreamer.txt new file mode 100644 index 0000000..2240aa3 --- /dev/null +++ b/gstreamer.txt @@ -0,0 +1,7 @@ +rtsp_url = 'rtsp://admin:artpark123@192.168.0.222:554/Streaming/Channels/1/' +gstreamer_exe = 'gst-launch-1.0' + +p = sp.Popen(shlex.split(f'{gstreamer_exe} --quiet rtspsrc location={rtsp_url} latency=0 ! queue2 ! rtph264depay ! avdec_h264 ! videoconvert ! capsfilter caps="video/x-raw, format=BGR" ! fdsink'), stdout=sp.PIPE) + +raw_image = p.stdout.read(width * height * 3) +frame = np.frombuffer(raw_image, np.uint8).reshape((height, width, 3))