Skip to content

Commit

Permalink
Create gstreamer.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
poornimajd authored Mar 1, 2023
1 parent 8e71a05 commit 22fa87d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gstreamer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rtsp_url = 'rtsp://admin:[email protected]: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))

0 comments on commit 22fa87d

Please sign in to comment.