Hi,
Generally we run gstreamer pipeline in cv2.VideoCapture() and cv2.VideoWriter(). Please refer to the sample:
V4l2src using OpenCV Gstreamer is not working in Jetson Xavier NX - #3 by DaneLLL
Displaying to the screen with OpenCV and GStreamer - #9 by DaneLLL
For using software encoder, the pipeline in cv2.VideoWriter() will be like:
"appsrc ! video/x-raw, format=BGR ! queue ! videoconvert ! video/x-raw,format=I420 ! x264enc ! h264parse ! matroskamux ! filesink location=test.mkv "