I am trying to connect the Raspberry Pi HQ camera to the Jetson Nano.
I have configured the pins under jetson-io (both options with IMX477 were tested) and tried to launch a variety of commands like this: gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! ‘video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1, format=NV12’ ! nvvidconv ! ‘video/x-raw(memory:NVMM),format=I420’ ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0 -v
Unfortunately I always get an error message like this (No cameras available):
R8 was removed today. Now it seems to work partly.
Attached you can find klogs and output in terminal for the command mentioned before (camera window doesnt open): output_camera.txt (7.6 KB) klogs (1).txt (66.4 KB)
After that i tested CSI code from CSI Module. The command ( ‘gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! nvoverlaysink’) and C++ program worked for me without any problems!!!, but by running python i am getting next error:
andrii@andrii-desktop:~/PythonProjects/CSI-Camera$ python simple_camera.py
nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, framerate=(fraction)60/1 ! nvvidconv flip-method=0 ! video/x-raw, width=(int)960, height=(int)540, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink
Error: Unable to open camera
It looks really strange: everything works when i am starting it from terminal via gst-launch… but the same command is not recognised in python scripts (error messages: unable to open camera or Assertion failed)
Please check if opencv from python has gstreamer support with
import cv2
# Check for gstreamer support from opencv
import re
print('GStreamer support: %s' % re.search(r'GStreamer\:\s+(.*)', cv2.getBuildInformation()).group(1))
Once the python opencv library supports gstreamer backend, it should work with the pipeline from his simple_camera.py script.
His own script pipeline is wrong as it doesn’t feed appsink.
Also you may advise to check if the VideoCapture successfully opened (cam.isOpened()) before trying to use it.
The answer was NO, cam.isOpened() returned False.
I unistalled opencv and followed these steps to install it with GStreamer. Now everything works fine. Thanks a lot!