I am trying to view live camera footage from a Jetson Nano on a PC running Windows 10. My Jetson is using a Rspberry Pi camera v2.1. I also downloaded gstreamer on my PC.
Here is the Python code that I run from the Jetson side, abridged for clarity and with my IP address redacted:
import cv2
print (cv2.version)
dispW= 640
dispH= 480
flip=2camSet=‘nvarguscamerasrc ! video/x-raw(memory:NVMM), width=3264, height=2464, format=NV12, framerate=21/1 ! nvvidconv flip-method=’+str(flip)+’ ! video/x-raw, width=‘+str(dispW)+’, height=‘+str(dispH)+’, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink’
cam = cv2.VideoCapture(camSet)
out = cv2.VideoWriter(“appsrc ! video/x-raw, format=BGR ! queue ! videoconvert ! video/x-raw, format=BGRx ! nvvidconv ! omxh264enc ! video/x-h264, stream-format=byte-stream ! h264parse ! rtph264pay pt=96 config-interval=1 ! udpsink host= port=1234”, cv2.CAP_GSTREAMER, 0, 25.0, (1920, 1080))
while True :
ret,frame = cam.read() cv2.imshow('piCam',frame) if ret: out.write(frame) key = cv2.waitKey(1) if key==ord('q'): print("Quit") break
cam.release()
out.release()
cv2.destroyAllWindows()
On my Windows PC, I open up the Command Prompt, navigate to C:\gstreamer\1.0\msvc_x86_64\bin and I run the following command:
gst-launch-1.0 -v udpsrc port=1234
caps = “application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96” !
rtph264depay ! decodebin ! videoconvert ! autovideosink
However, all that shows up is a window that’s completely black. I am able to see the video fine on my Jetson Nano.
Any help into this matter would be greatly appreciated.