Python3 unable to open camera jetson nano jetpack 4.6 -2022

I need to work in python3 to use mediapipe but even open the camera its not posible

I have a this is a popular code to start with an CSI camera

that runs in python 2 ok :

doesnt work

and all the cameras work with this pipeline to test it

gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! \
   'video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1' ! \
   nvvidconv flip-method=0 ! 'video/x-raw,width=960, height=540' ! \
   nvvidconv ! nvegltransform ! nveglglessink -e

the cameras also work for the python 2 codes

even I change with 3 cameras and any can’t work on python3 but in python 2 works

  2. simple webcam

always the erros code are :
unable to open camera
empty frame

I think that is a problem of opencv versions in opencv o python2 its different at the version of opencv of python3 . I reflashed a jetpak and start from 0 like in this video to use media pipe but the sames error and the same issue

so I cant use a camera on python3

Please check with below topic.

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