# Jetson orin nano python cant initialize Imx219 camera

**URL:** <https://forum.opencv.org/t/jetson-orin-nano-python-cant-initialize-imx219-camera/18247>\
**Category:** Python\
**Tags:** nvidia\
**Created:** [July 12, 2024, 2:05pm UTC](https://forum.opencv.org/t/jetson-orin-nano-python-cant-initialize-imx219-camera/18247 "2024-07-12T14:05:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enes\_Ulutas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/enes_ulutas/32/10788_2.png) [@Enes\_Ulutas](https://forum.opencv.org/u/Enes_Ulutas)\
**Post date:** [July 12, 2024, 2:05pm UTC](https://forum.opencv.org/t/jetson-orin-nano-python-cant-initialize-imx219-camera/18247/1 "2024-07-12T14:05:56Z")

</div>

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](https://github.com/mdegans/nano_build_opencv). 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

---

<div class="post-metadata">

**Author:** ![ashutosh](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@ashutosh](https://forum.opencv.org/u/ashutosh)\
**Post date:** [July 12, 2024, 4:43pm UTC](https://forum.opencv.org/t/jetson-orin-nano-python-cant-initialize-imx219-camera/18247/2 "2024-07-12T16:43:44Z")

</div>

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](https://www.youtube.com/watch?v=art0-99fFa8)

---

<div class="post-metadata">

**Author:** ![Enes\_Ulutas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/enes_ulutas/32/10788_2.png) [@Enes\_Ulutas](https://forum.opencv.org/u/Enes_Ulutas)\
**Post date:** [July 13, 2024, 7:25am UTC](https://forum.opencv.org/t/jetson-orin-nano-python-cant-initialize-imx219-camera/18247/3 "2024-07-13T07:25:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bobatproventus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/bobatproventus/32/10807_2.png) [@bobatproventus](https://forum.opencv.org/u/bobatproventus)\
**Post date:** [July 21, 2024, 11:14pm UTC](https://forum.opencv.org/t/jetson-orin-nano-python-cant-initialize-imx219-camera/18247/4 "2024-07-21T23:14:29Z")

</div>

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:

```auto
dmesg | grep imx219

```

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

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

```

Try one:

```auto
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](http://www.proventusnova.com)
