Hello,
I am trying to display a camera image and to record the video at the same time in python,
with H264 recording at 120FPS.
I have the following working pipeline on the command line:
gst-launch-1.0 nvarguscamerasrc sensor-id=0 \
! 'video/x-raw(memory:NVMM),width=1280, height=720, framerate=120/1, format=NV12' \
! tee name=t \
t. ! queue \
! omxh264enc ! 'video/x-h264,stream-format=(string)byte-stream' ! filesink location=test.h264 \
t. ! queue ! nvvidconv ! xvimagesink
Now, I am trying to setup a cv2.VideoCapture based on this pipeline:
My pipeline string looks like this:
pipeline_str = """
nvarguscamerasrc sensor-id=0
! 'video/x-raw(memory:NVMM),width=1280, height=720, framerate=120/1, format=NV12'
! tee name=t
t. ! queue
! omxh264enc ! 'video/x-h264,stream-format=(string)byte-stream' ! filesink location=test.h264
t. ! queue name='display_queue'
! nvvidconv
! video/x-raw, width=(int)640, height=(int)360, format=(string)BGRx
! videoconvert ! video/x-raw, format=(string)BGR
! appsink
"""
# This call hungs the application
cap = cv2.VideoCapture(pipeline_str, cv2.CAP_GSTREAMER)
Could someone help me?
Many thanks in advance!