To capture YUY2 NVMM buffer from usb camera, I customized the nvv4l2camerasrc plugin with advice from Macrosilicon USB - #5 by DaneLLL.
But it did not work on some NX boards.
I can see green screen as follow:
My pipeline is :
gst-launch-1.0 nvv4l2camerasrc device=/dev/video3 ! ‘video/x-raw(memory:NVMM),format=YUY2,width=1920,height=1080,framerate=30/1’ ! nvvidconv ! ‘video/x-raw,format=I420’ ! xvimagesink
But if I use v4l2src, the output is normal.
So it seems nvv4l2camerasrc or its dependent nvidia libs have some issues here.
Could you please give me some insights how to debug further?
Please run 12_camera_v4l2_cuda and check if you can see good video preview. The sample is in
May also try other resolution such as 640x480. See if it is specific to 1920x1080.
I can see good preview with the given sample 12_camera_v4l2_cuda.
I have found one interesting point:
If I run a v4l2src pipeline first, then run the nvv4l2camerasrc pipeline, then no green screen issue.
But issue is still there if I unplug and plug the usb camera again.
The ioctl() calls of 12_camera_v4l2_cuda and nvv4l2camerasrc are not identical. This may be the rootcause of the failure. Since 12_camera_v4l2_cuda works well with the sensor, please check if you can unify the ioctl() calls to nvv4l2camerasrc and try.
I followed your advice and found the difference.
In nvv4l2camerasrc, pixel format should be specified as V4L2_PIX_FMT_YUYV before calling ioctl(src->video_fd, VIDIOC_S_FMT, src->fmt).
It happens to be that the default format of my camera is M-JPEG.
After this fix, no green screen issue seen anymore.
Thanks a lot.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.