gstreamer( gst-lanch 1.0) quits abnormally after running for a while, restarts the service (systemctl restart nvargus-daemon.service)and it works fine.
eg1.
gst-launch-1.0 \ nvarguscamerasrc sensor-id=0 \ ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=(string)NV12, framerate=(fraction)30/1' \ ! nvvidconv ! 'video/x-raw,width=768, height=432' \ ! fpsdisplaysink text-overlay=1 video-sink=xvimagesink sync=0 -v
eg2.
def gstreamer_pipeline(vc, display_width=768, display_height=432):
return (‘nvarguscamerasrc sensor-id=%d !’
‘video/x-raw(memory:NVMM), width=1920, height=1080, format=(string)NV12, framerate=(fraction)30/1 !’
'nvvidconv ! ’
'video/x-raw, width=(int)%d, height=(int)%d, format=(string)BGRx ! ’
'videoconvert ! ’
‘video/x-raw, format=(string)BGR ! appsink’
% (vc, display_width, display_height))
cmd = gstreamer_pipeline(self.vc)
print(cmd)
self.cap = cv2.VideoCapture(cmd, cv2.CAP_GSTREAMER)
,
One other question, how do I use fpsdisplaysink in opencv and how does it work with appsink?