Jetson Inference trouble accesing external camera


I am working with LI-IMX324 ADAS camera using Jetson TX2. For object detection, I am using Jetson Inference.

When I run : $ v4l2-ctl --list-formats-ext
I get format : YUYV and size (3840*1928).

My question - Is there any way that Jetson Inference do object detection from this format directly?

Or I have to convert it into RGB or some other format ? If so, which modifications are requires?


It depends on your detection model actually.
If your model is designed as YUYV input, you don’t need to change the format.

But many open source detection use BGR input, if you use them, you will have to change the input and the channel.
Also, many driver provided the format change even through v4l interface.

So the answer is it depends. You can check with your camera vendor for suggestion, also you can discuss it with who provides the detection model.

1 Like

You don’t have to convert, gst-camera will use a gstreamer pipeline for converting into RGB.
Assuming your USB cam is /dev/video1, the following should be enough:

camera = jetson.utils.gstCamera(3840, 1928, "/dev/video1")
1 Like

Thanks for the answer. I have contacted provider. I got to know that they don’t have any software tool for Jetson that convert YUYV format to BGR. I am looking for solution overa week so far no success. I am using Jetson Inference from Dustynv just to let you know.

Thanks for your response :)


Thank you for answering. Just to make sure, can you tell me which syntax is needed to be changed where I can put (camera = jetson.utils.gstCamera(3840, 1928, “/dev/video1”)).

I would appreciate your help.


I was refering to python examples in Real-Time object detection in 10 lines of python.
If you’re just running the jetson-inference examples , you would just try something like: --camera=/dev/video1 --width=3840 --height=1928
1 Like

I am working with Jetson Inference and already tried --camera=/dev/video1 --width=3840 --height=1928

I am getting feed from in-built camera on both video0 and video1.

What could be the possible reason?

Not sure what you mean here…May you detail further ?

Also note that if you’ve upgraded OTA your L4T version, you may have to delete some cache such as:

1 Like

It seems there is some problem with camera. Camera is working fine with qv4l2 -d 1, but when i use : --camera=/dev/video1 --width=3840 --height=1928

I am getting feed from in-built camera.

Not sure, but I also wonder if the problem may rather be on display side. Does your monitor support 4K ?
Probably qv4l2 resizes to a smaller resolution, so it can be displayed.
If not, you’d better try a smaller resolution that fits into your screen.Check available modes from your camera with

v4l2-ctl -d1 --list-formats-ext

If using imagenet-camera without any extra argument (would use CSI onboard cam), does it display ?

when I use without any extra argument, I get the feed from onboard camera without any trouble.

$ v4l2-ctl -d1 --list-formats-ext
I get format : YUYV and size (3840*1928).

For better advice, please share the exact output of:

# Assuming your LI cam has video node /dev/video1
v4l2-ctl -d1 --list-formats-ext

xrandr --props