Unable to use gstreamer for IMX477 camera on Jetpack 6.0 Jetson Orin NX

The only pixel format of the camera being recognized by the os (configured on the dual MIPI connection tho I have the same issues on the 4 lane) is RG10 bayer at two different dimensions and frame rates. From what I have gathered very few gstreamer elements support this pixel format. I would like the device tree overlay to support more such as YUYV. I have tried to decompile /boot/tegra234-p3767-camera-p3768-imx477-dual.dtbo and add a mode2 section for a different pixel format but that causes the same types of gstreamer errors as well (that is if it happens to load without dmesg errors).

Sample pipeline:
gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! \ 'video/x-bayer, format=(string)rggb, width=3840, height=2160, framerate=30/1' ! \ filesink location=output.raw -e

Yields:
WARNING: erroneous pipeline: could not link nvv4l2camerasrc0 to filesink0, nvv4l2camerasrc0 can't handle caps video/x-bayer, format=(string)rggb, width=(int)3840, height=(int)2160, framerate=(fraction)30/1

Confirmation of video format:
v4l2-ctl -d /dev/video0 --list-formats-ext

Output:

ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'RG10' (10-bit Bayer RGRG/GBGB)
                Size: Discrete 3840x2160
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.017s (60.000 fps)

Ridgerun has some support for this for earlier versions of Jetpack but doesn’t include the Orin NX.
Any help or direction would be very much appreciated!

Hello @bcastor,

The problem you are seeing is due to trying to use a filesink right after your nvarguscamerasrc.

Please try the following pipeline:

gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=3840, height=2160, format=NV12, framerate=30/1' ! nvv4l2h264enc bitrate=8000000 ! h264parse ! qtmux ! filesink location=output.mp4

Trying to get YUYV directly from the camera, requires you to first make sure that the camera is able to provide the output in that format. Then you would need to create a capture mode for that on the device tree and add the respective register table for it in your driver.

However, the pipeline I mentioned, should help you capture and store into a mp4 file using h264 encoding.

If you are trying to capture raw for a specific reason, we could work on a different pipeline for you.

Would you mind sharing a bit of detail on what you want to achieve?

regards,
Andrew
Embedded Software Engineer

Hi Andrew.

I get the error WARNING: erroneous pipeline: no element "nvarguscamerasrc". I was under the impression this was installed with the entire jetpack SDK which was performed on the orin nx in question.

You’re right that the IMX477 sensor will only output bayer directly. At the end of the day I’m just looking for a way to ingest with gstreamer without a secondary application or daemon running (i.e. some sort of cv2 solution).

According to ChatGBT: “On the Jetson Orin NX with JetPack 6.0, you can use the NVIDIA Image Signal Processor (ISP) to handle debayering from the IMX477 and convert it to YUV. The NVIDIA ISP is highly optimized for this task and can efficiently convert raw Bayer formats (like RGGB) into YUV formats such as NV12, which is commonly used for video processing.”

Running gst-launch-1.0 -e nvv4l2camerasrc ! 'video/x-raw(memory:NVMM), width=3840, height=2160, format=NV12, framerate=30/1' ! nvv4l2h264enc bitrate=8000000 ! h264parse ! qtmux ! filesink location=output.mp4 (notice nvv4l2camerasrc not nvarguscamerasrc) outputs WARNING: erroneous pipeline: could not link nvv4l2camerasrc0 to nvv4l2h264enc0, nvv4l2camerasrc0 can't handle caps video/x-raw(memory:NVMM), width=(int)3840, height=(int)2160, format=(string)NV12, framerate=(fraction)30/1.

Hello @bcastor,

That is very strange.
You are correct, nvarguscamerasrc should already be part of your system.

And the error you are experiencing by changing the source element, is expected, since it wont handle the caps set on the pipe.

Are you using docker or running commands directly on the board ?

And have you flashed the board recently?

Regards,
Andrew
Embedded Software Engineer

Yeah, I am ssh’d on the board directly and it was flashed last week with latest greatest :/ (L4T JP 6 (36.3)). I’m checking around now to see if there is some way to confirm the install/sdk status on the board. After the flash I compiled opencv2 for cuda and gstreamer support which might have caused something to be overwritten… not sure yet.

@bcastor,

Yeah, that might have been the case.
Could be that the GStreamer version you compiled caused the argus element not to be present.

regards,
Andrew
Embedded Software Engineer

@bcastor,

Can you provide me with the output of the following command?

ls /usr/lib/aarch64-linux-gnu/gstreamer-1.0 | grep nv

And do you know where are the new GStreamer libraries installed ?

regards,
Andrew
Embedded Software Engineer

libgstaudioconvert.so
libgstautoconvert.so
libgstnvarguscamerasrc.so
libgstnvcodec.so
libgstnvcompositor.so
libgstnvdrmvideosink.so
libgstnveglglessink.so
libgstnveglstreamsrc.so
libgstnvegltransform.so
libgstnvipcpipeline.so
libgstnvivafilter.so
libgstnvjpeg.so
libgstnvtee.so
libgstnvv4l2camerasrc.so
libgstnvvidconv.so
libgstnvvideo4linux2.so
libgstnvvideosink.so
libgstnvvideosinks.so
libgstrtponvif.so
libgstvideoconvert.so
nvgstcapture-1.0_README.txt
nvgstipctestapp-1.0_README.txt
nvgstplayer-1.0_README.txt

Location dpkg -L gstreamer1.0-tools

/usr
/usr/bin
/usr/bin/gst-inspect-1.0
/usr/bin/gst-launch-1.0
/usr/bin/gst-stats-1.0
/usr/bin/gst-tester-1.0
/usr/bin/gst-typefind-1.0
/usr/lib
/usr/lib/aarch64-linux-gnu
/usr/lib/aarch64-linux-gnu/gstreamer1.0
/usr/lib/aarch64-linux-gnu/gstreamer1.0/gstreamer-1.0
/usr/lib/aarch64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-completion-helper
/usr/share
/usr/share/bash-completion
/usr/share/bash-completion/completions
/usr/share/bash-completion/completions/gst-inspect-1.0
/usr/share/bash-completion/completions/gst-launch-1.0
/usr/share/bash-completion/helpers
/usr/share/bash-completion/helpers/gst
/usr/share/doc
/usr/share/doc/gstreamer1.0-tools
/usr/share/doc/gstreamer1.0-tools/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/gst-inspect-1.0.1.gz
/usr/share/man/man1/gst-launch-1.0.1.gz
/usr/share/man/man1/gst-stats-1.0.1.gz
/usr/share/man/man1/gst-typefind-1.0.1.gz
/usr/share/doc/gstreamer1.0-tools/changelog.Debian.gz```

@bcastor,

Ok, the first output shows that nvarguscamerasrc is in there, it is just not being found by GStreamer.

What happens if you inspect using the full path?

gst-inspect-1.0 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvarguscamerasrc.so

regards,
Andrew
Embedded Software Engineer

I have started to reflash the board now but will try that command afterwards if needed. Either way strange it wouldn’t know how to find it whilst it can find some of the other nv* elements.

@bcastor,

Yes, that is certainly strange.
The only thing that comes to mi mind is that GStreamer might have installed into a different path.

But either way, sounds good. Please keep us posted.

regards,
Andrew
Embedded Software Development

Hi again. I reflashed the board and followed the steps to install gstreamer here: Accelerated GStreamer — Jetson Linux Developer Guide documentation

However, it’s still not found:

No such element or plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvarguscamerasrc.so'

Hello @bcastor,

You should not need to install GStreamer after flashing.

It should already be part of the SW stack after flashing.

What is the output of the following command ?

ls /usr/lib/aarch64-linux-gnu/gstreamer-1.0 | grep nv

Regards,
Andrew
Embedded Software Engineer

Hi @bcastor
What could be happening is that nvarguscamerasrc is getting blacklisted for some reason. You can check if it is in the blacklist with:

gst-inspect-1.0 -b

The other possibility is that you are missing some of the base dependencies for nvarguscamerasrc to work correctly. Try running:

sudo apt-get install --reinstall nvidia-l4t-multimedia

Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com

The following pipeline now works after reinstalling the entire jetpack 6.0 with full CUDA and SDK components. Thanks for your help! gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), width=3840, height=2160, format=NV12, framerate=30/1' ! nvvidconv ! nvv4l2h264enc bitrate=4000000 ! h264parse ! mp4mux ! filesink location=output.mp4

Hello @bcastor,

That is great!

Please do not hesitate to reach out if you need further assistance, we are glad to help.

regards,
Andrew
Embedded Software Engineer