I’m using the gstreamer pipeline as demonstrated in some other posts on this forum but the program won’t completely stop once I’m done taking pictures. After taking the picture, the terminal shows
GST_ARGUS: Cleaning up
GST_ARGUS:
PowerServiceHwVic::cleanupResources
and won’t relinquish control back to me unless I ctrl-Z out of the program. How can I close the pipeline? Additional question: Is there a way to suppress the terminal output associated with using the gstreamer pipeline?
Here is the python code being tested.
def gstreamer_pipeline (capture_width=3280, capture_height=2464, display_width=3280,
display_height=2464, framerate=21, flip_method=2):
return ('nvarguscamerasrc ! '
'video/x-raw(memory:NVMM), '
'width=(int)%d, height=(int)%d, exposuretimerange=(string)2000000 2000000, '
'format=(string)NV12, framerate=(fraction)%d/1 ! '
'nvvidconv flip-method=%d ! '
'video/x-raw, width=(int)%d, height=(int)%d, format=(string)BGRx ! '
'videoconvert ! '
'video/x-raw, format=(string)BGR ! appsink '
% (capture_width, capture_height, framerate, flip_method, display_width, display_height))
def testGStreamer():
camera = cv2.VideoCapture(gstreamer_pipeline(), cv2.CAP_GSTREAMER)
t1 = time.time()
ret, image = camera.read()
t2 = time.time()
saveImage(image, 'GStreamer_' + time.strftime('%m.%d_%H.%M.%S'))
print 'Time elapsed = ' + str(t2 - t1) + ' seconds'
camera.release()
testGStreamer()
EDIT: Additionally, setting the exposure time like I did in the code above crops the image for some reason. The exposure appears to be unaffected. There seems to be some sort of auto-exposure or auto-whitebalance going on as well, is there a way to disable that? For my purposes, anything auto needs to be turned off. The auto settings are resulting in very poor image quality.