Green tint with nvv4l2camerasrc

Hi,
I had tried to run gstreamer pipeline for my YUYV camera using nvv4l2camerasrc. But I was getting green image int it. So i referred to previous topics on the fourm - https://forums.developer.nvidia.com/t/macrosilicon-usb/157777/4

According to the above link i need to apply patch to gstnvv4l2camerasrc.cpp file.
But when i checked into the public sources(BSP) folder, the gstnvv4l2camerasrc is an external folder to the kernel sources. I’m not familiar much with the BSP sources and building them, so i would like to know how to build this file and how to flash it on to the board

Thanks

Hi,

For the camera basic functionality first needs to check the device and driver configuration.
You can reference to below program guide for the detailed information of device tree and driver implementation.
https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/SD/CameraDevelopment/SensorSoftwareDriverProgramming.html?highlight=programing#sensor-software-driver-programming

Please refer to Applications Using V4L2 IOCTL Directly by using V4L2 IOCTL to verify basic camera functionality.
https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/SD/CameraDevelopment/SensorSoftwareDriverProgramming.html?highlight=programing#to-run-a-v4l2-ctl-test

Once confirm the configure and still failed below link help to get log and some information and some tips for debug.
https://elinux.org/Jetson/l4t/Camera_BringUp#Steps_to_enable_more_debug_messages

Thanks!

the cameras are working with v4l2src well.
to make it work with nvv4l2camerasrc i need to modify the gstnvv4l2camerasrc.cpp file. So do i need to build it as a .so library and replace library on board or what do other procedure do i need to do

when i checked for v4l2-ctl test
v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=YUY2 --stream-mmap --set-ctrl=sensor_mode=0 --stream-count=100 -d /dev/video0
The pixelformat ‘YUY2’ is invalid
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
<<<<<<<<

Thanks

Refer this link for building: see if it helps…

https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/SD/Kernel/KernelCustomization.html

i have tried this previously but they only build the kernel_srcs. but gstreamer is external to kernel_srcs.

Thanks

Hello @srivathsan.p

To compile the gstnvv4l2camerasrc.cpp file you have to get the Driver Package (BSP) Sources (these are for JetPack 6.2, please download for the L4T version that you are using). Then, follow the next instructions:

  • Extract the gst-nvv4l2camera_src.tbz2 from the public_sources.tbz2 as
tar -xjf public_sources.tbz2 Linux_for_Tegra/source/gst-nvv4l2camera_src.tbz2
  • Copy to the board:
scp Linux_for_Tegra/source/gst-nvv4l2camera_src.tbz2 <board_username>@<board_IP>:<path>
  • Ssh to the board and run
tar -xvf gst-nvv4l2camera_src.tbz2
cd gst-nvv4l2camera
sudo apt install nvidia-l4t-jetson-multimedia-api
cp /usr/src/jetson_multimedia_api/include/nvbufsurface.h .
  • Then compile the gst-nvv4l2camera as:
make

Before installing it, please make a backup of the libgstnvv4l2camerasrc.so binary as:

sudo cp /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvv4l2camerasrc.so /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvv4l2camerasrc.so.bkp

Then, install the element as:

sudo make install

This is how you can compile the gstnvv4l2camerasrc, I did not test the patch for the Green tint since I do not have the same environment as you.

I hope this helps!

Regards!
Eduardo Salazar
Embedded SW Engineer at RidgeRun

Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com

Hi,
Thanks it worked.
The doubt I had was whether to build the library only or any other kernel dtsi files.

I tried with this pipeline it gave a clear image
gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! ‘video/x-raw(memory:NVMM), format=(string)YUY2, width=(int)1920, height=(int)1536, framerate=(fraction)30/1’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), format=(string)NV12’ ! nv3dsink

Thanks

Hello @srivathsan.p

As you have already experienced, you need to build the library on the board only, you do not need any kernel files to build the element binary.

Regards!

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