CSI Camera unable to capture or preview image

Hello, I was originally trying to create an nvidiaio.internal.camera object in matlab to capture and record an image.
I used the following code:

function jetson_capture() %#codegen
    nvidiademo_setup('Xavier_Camera');
    hardware = jetson('192.168.10.10','****','****');

    camlist = getCameraList(hardware)
    camera0 = camera(hardware,"vi-output, imx477 30-0010",[1920 1080]);

        img = snapshot(camera0);
        image(img)

%     clear camera0;  
end

I would receive the following error:

Error using nvidiaio.internal.camera/open
Unable to pull the frame.

Error in nvidiaio.internal.camera (line 86)
            obj.open();

Error in nvidiaboard/camera

Error in jetson_capture (line 7)
    camera0 = camera(hardware,"vi-output, imx477 30-0010",[1920 1080]);

From this it appears that the xavier is having issue communicating with camera. I tried to confirm the camera is seen by the xavier device and preview it using nvgstcapture-1.0. However, when I run this, nothing happens. It states that it enters the capture loop, but the preview image does not show up.
Eventually, the following error shows up:

(Argus) Error Timeout:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 215)
(Argus) Error Timeout: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 102)
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:526 Failed to create CameraProvider

I have been unable to track down where this cameraProvider failure is coming from.
Additionally, I have tried to confirm the camera device is working using v4l2-ctl --device /dev/video0 --stream-mmap --set-ctrl bypass_mode=0 --stream-count=10D, but it gives me the error ‘VIDIOC_STREAMON: failed: Invalid argument’
This leads me to believe there is an issue with the camera communication. Any advice would be greatly appreciated

Did you try gst-launch-1.0 command?

gst-launch-1.0 nvarguscamerasrc ! "video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080,format=(string)NV12, framerate=(fraction)30/1" ! nvvidconv ! xvimagesink sync=false

Hi Shane, thanks for the reply. When I run gst-launch-1.0 nvarguscamerasrc ! "video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080,format=(string)NV12, framerate=(fraction)30/1" ! nvvidconv ! xvimagesink sync=false, I get the following output on the terminal:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
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 354.000000; Exposure Range min 16000, max 710227000;

GST_ARGUS: 2028 x 1520 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 354.000000; Exposure Range min 16000, max 704225000;

GST_ARGUS: 1920 x 1080 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 354.000000; Exposure Range min 16000, max 704225000;

GST_ARGUS: Running with following settings:
   Camera index = 0 
   Camera mode  = 2 
   Output Stream W = 1920 H = 1080 
   seconds to Run    = 0 
   Frame Rate = 59.999999 
GST_ARGUS: PowerService: requested_clock_Hz=27216000
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.

There is an instance of gst-launch-1.0 that is created, but it appears to be displaying a still image of my desktop and terminal

It is worth noting that when I run v4l2-ctl --list-formats-ext, I receive the following output:

ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'RG10'
	Name        : 10-bit Bayer RGRG/GBGB
		Size: Discrete 4032x3040
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 2028x1520
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 1920x1080
			Interval: Discrete 0.017s (60.000 fps)

Add -v to the command line to show the fps at console.

I ran

gst-launch-1.0 nvarguscamerasrc ! "video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080,format=(string)NV12, framerate=(fraction)30/1" ! nvvidconv ! xvimagesink sync=false -v

And got this output:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)YUY2
/GstPipeline:pipeline0/GstXvImageSink:xvimagesink0.GstPad:sink: caps = video/x-raw, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)YUY2
/GstPipeline:pipeline0/Gstnvvconv:nvvconv0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1
(Argus) Error Timeout:  (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 215)
(Argus) Error Timeout: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 102)
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:526 Failed to create CameraProvider
Got EOS from element "pipeline0".
Execution ended after 0:01:00.038782816
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

It looks like the fps is 30.
The gst-launch-1.0 does keep displaying a video, unless it is minimized or the size is changed.

Maybe need to check how matlab using the camera to figure the problem.

I was originally thinking that too. However, I cannot get an image to display from the camera using any linux commands, either. This leads me to believe it is an issue with the Jetson communicating with camera, not with matlab.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.