Gstreamer Segmentation Fault - IMX477 - Jetson Nano B01

Hello!

I got myself a Jetson Nano b01 (has 2 CSI-MIPI ports) and 2 Raspberry PI HQ Cameras (Sensor: IMX477).

When running the following command in the terminal, i can see that the camera(s) work:

gst-launch-1.0 nvarguscamerasrc sensor_id=1 ! "video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)60/1" ! nvvidconv flip-method=0 ! "video/x-raw, width=(int)1920, height=(int)1080" ! videoconvert ! xvimagesink

However in openframeworks the ofVideoGrabber throws a segmentation fault. As well when i try using the ofGstVideoUtils pipeline as followed:

gst.setPipeline("nvarguscamerasrc sensor_id=1 ! video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)60/1 ! nvvidconv flip-method=1", OF_PIXELS_NATIVE, true);

Log:

[notice ] ofGstUtils: setPipelineWithSink(): gstreamer pipeline: nvarguscamerasrc sensor_id=1 ! video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)60/1 ! nvvidconv flip-method=1 ! appsink name=ofappsink enable-last-sample=0 caps="video/x-raw,format={RGBA,BGRA,RGB,BGR,RGB16,GRAY8,YV12,I420,NV12,NV21,YUY2}"
[verbose] ofGstUtils: startPipeline(): attaching callbacks
[verbose] ofGstUtils: gstHandleMessage(): unhandled message from src
[verbose] Pipeline is live and does not need PREROLL waiting PLAY
[verbose] ofGstUtils: gstHandleMessage(): unhandled message from pipeline0
[verbose] ofGstUtils: gstHandleMessage(): unhandled message from src
[verbose] ofGstUtils: gstHandleMessage(): unhandled message from pipeline0
after INIT Grabber
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 4032 x 3040 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 22.250000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 22.250000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 2592 x 1944 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 22.250000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 2560 x 1440 FR = 40.000000 fps Duration = 25000000 ; Analog Gain range min 1.000000, max 22.250000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
   Camera index = 1 
   Camera mode  = 1 
   Output Stream W = 1920 H = 1080 
   seconds to Run    = 0 
   Frame Rate = 59.999999 
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
[notice ] ofGstVideoUtils: allocating with 1080x1920 NV12
[verbose] ofGstUtils: gstHandleMessage(): async done
Segmentation fault (core dumped)

Would be glad for any help, hint towards a direction.
Thanks
numu

Ok, i got it… the problem was (of course) the G-Streamer Pipeline.
Thanks to Jetson-Hacks i found the proper way.

This is the solution:

ofApp.h

		ofGstVideoUtils gst1;
		ofGstVideoUtils gst2;
		ofTexture tex1;
		ofTexture tex2;

		int w;
		int h;

ofApp.cpp

void ofApp::setup(){
    w = ofGetWidth();
    h = ofGetHeight();

    //gst.setPixelFormat(GL_RGB);
    gst1.setPipeline("nvarguscamerasrc sensor-id=0 ! "
                    "video/x-raw(memory:NVMM), "
                    "width=(int)1920, height=(int)1080, "
                    "format=(string)NV12, framerate=(fraction)60/1 ! "
                    "nvvidconv flip-method=0 ! "
                    "video/x-raw, width=(int)1920, height=(int)1080, format=(string)BGRx ! "
                    "videoconvert ! "
                    "video/x-raw, format=(string)RGB", OF_PIXELS_NATIVE, true);
    gst1.startPipeline();
    gst1.play(); 
    tex1.allocate(w, h, GL_RGB);

    gst2.setPipeline("nvarguscamerasrc sensor-id=1 ! "
                    "video/x-raw(memory:NVMM), "
                    "width=(int)1920, height=(int)1080, "
                    "format=(string)NV12, framerate=(fraction)60/1 ! "
                    "nvvidconv flip-method=0 ! "
                    "video/x-raw, width=(int)1920, height=(int)1080, format=(string)BGRx ! "
                    "videoconvert ! "
                    "video/x-raw, format=(string)RGB", OF_PIXELS_NATIVE, true);
    gst2.startPipeline();
    gst2.play(); 
    tex2.allocate(w, h, GL_RGB);
    
}

//--------------------------------------------------------------
void ofApp::update(){

    gst1.update();
    tex1.loadData(gst1.getPixels(), GL_RGB);

    gst2.update();
    tex2.loadData(gst2.getPixels(), GL_RGB);
}

//--------------------------------------------------------------
void ofApp::draw(){

    tex1.draw(w/2*-1, 0, w, h);
    tex2.draw(w/2, 0, w, h);
}