Jetson orin nano python cant initialize Imx219 camera

Hey,
I am having problems using cv2 to open my ımx camera on jetson orin nano.

When ı try to open the camera in terminal with nvgstcapture it works but whenever ı try to open it with my cv2 ı am getting this error code

Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:754 Invalid camera device specified 1 specified, 0 max index
[ WARN:0] global /tmp/build_opencv/opencv/modules/videoio/src/cap_gstreamer.cpp (1100) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
Error: Could not read frame.

I believe there is a problem with my build. I tried to build by following GitHub - mdegans/nano_build_opencv: Build OpenCV on Nvidia Jetson Nano. And option to download Gstreamer support is on there.
But weirdly Gstreamer support seems on when ı look to python2 but not on python3 (ı checked with cv2.getBuildInformation())
So ı said maybe it works with python 2 and ı am getting the same errors.

why its not ON in python3. How can ı fix it and does it solve my problem? Does anyone had the same problem?

Thank you for your answers

Check if your piline as well version of opencv while executing with python3 if not correct version you need to link with proper folder where open cv is present. check this video https://www.youtube.com/watch?v=art0-99fFa8

I already build my opencv by using this video. Didnt change much from the sh file too. So ı dont know why it doesnt work.

I had problems with sdk manager too, so ı am hesitate to build jetson from scratch.

Hi @Enes_Ulutas

This is rather a Jetson Nano issue than OpenCV one. Here some steps that you can do to try and check what might be going wrong.

Check if the camera was succesfully probed during boot and check for errors:

dmesg | grep imx219

Then you can try to manually dequeueing buffers from it using v4l-utils package:
Check formats:

v4l2-ctl -d /dev/video0 --list-formats-ext

Try one:

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1280,height=720,pixelformat=RG10  --set-ctrl bypass_mode=0 --stream-mmap

Let me know if you hit any error at that point.

Regards,
Bob @ www.proventusnova.com