How to use CSI camera with python jetpack 4.6 docker

Hello, I am using the ultralytics provided jetpack docker for jetson nano, but the opencv inside of it doesn’t come built with gstreamer support. How could I either rebuild the opencv to have gstreamer and use it without breaking the docker, or use the csi camera in python in an alternative way? Also, I want to be able to display frames in the docker as well so it would be nice if I could also build opencv with gui support.

I’m going to tag @lakshanthad in on this one. He’s the guy who knows the most about working with Jetson. I’ll also send him a message to make certain he’s aware, and hopefully will be able to reply soonly!

Hello @EmperorWeno.

I will look into your request and try to come up with a solution.

Please wait. I will update here.

Thank you.

1 Like

So I ended up looking into this more myself and I was able to rebuild opencv with Gstreamer support and export the python path to take precedence over ultralytics opencv-headless. It was simpler than expected, and I was able to create two capture objects and run inference on their video feeds in python. However, I am on a jetson nano and between inference and displaying on a 1080*1920 display, the FPS was abysmal. I looked into the deepstream sdk and it looks like it could potentially help me a lot, since the display process would be made much more efficient (also the fact that I am running all of this in a docker makes it far slower because it has to communicate with the X11 and then get permission from host system to display). However, the ultralytics installation guide doesnt look like it would work for the Jetson nano because there is no native installation process for ultralytics on jetson nano, there is only a docker. The ultralytics guide for deepstream on jetson says it needs the jetson nano (jetpack 4.6) properly set up with the ultralytics packages and dependencies.

DeepStream has its own container. For Jetson Nano, the last suppported version is 6.0.1

Or you can perform native installation