Simple_Camera.py program not working on Orin Nano

I am trying to run simple_camera.py program. I have cloned these programs from github using following command:
git clone GitHub - jetsonhacks/CSI-Camera: Simple example of using a CSI-Camera (like the Raspberry Pi Version 2 camera) with the NVIDIA Jetson Developer Kit

trying to execute program using following commands:
cd CSI-Camera
python3 simple_camera.py

I am getting errors as below:

I have confirmed that camera is identified by system using command:
ls -l /dev/video*
response: /dev/video0

I installed python3 with command as below:
sudo apt-get install python3 python3-pip
Also installed libraries as below:
pip install numpy opencv-python torch torchvision

Also installed gstreamer as below:
sudo apt-get install gstreamer1.0-tools gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav

I have confirmed installation using following command:
gst-inspect-1.0 --version
for above command, I am getting response as :
gst-inspect-1.0 version 1.20.3
Gstreamer 1.20.3

Please help debugging the issue.

Hello @embedded5,

Can you try first verifying image capture with bare GStreamer?

Just run the following on a console:

gst-launch-1.0 nvarguscamerasrc ! fake sink

It should show some GStreamer messages, then it would look as if it was hanging and show something like timer. To stop it you can Ctrl+C. If all that happens without it breaking or showing any error messages. Then mess you are able to capture.

Then you can try capturing and previewing the image with GStreamer:

get-launch-1.0 nvarguscamerasrc ! nvvidconv ! xvimagesink

If that works, we can focus on fixing your Python script.

We have this wiki on How to capture images from NVIDIA Jetson Using Python which you can use as a base for your program.

That being said, if you were able to provide us with a bit more detail on what exactly are you looking to accomplish, we can give you a hand with a more specialized example.

best regards,
Andrew
Embedded Software Engineer at ProventusNova

1 Like

I tried command:
gst-launch-1.0 nvarguscamerasrc ! fakesink
Response to above command is as below:
WARNING: errorneous pipeline: no element ‘nvarguscamerasrc’

I also referred wiki link provided by you and checked all required installations:
sudo apt install python3-opencv python3-pip
pip3 install numpy
sudo apt install python3-gi gir1.2-gstreamer-1.0 gir1.2-gst-plugins-base-1.0

All installations seems to be intact.

My final application is to have object detection on live stream coming from camera.

I installed nvidia-l4t-gstreamer using command:
sudo apt install nvidia-l4t-gstreamer

This made the program sample-camera.py to work.

Thankyou @proventusnova for your help!

1 Like

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