Gst-nvv4l2camera compile error: can't find nvbufsurface.h

Hi, NV partners:

I have a YUV camera, which ISP build in. And I try to open camera with gst-lunch nvv4l2camerasrc plug-in:
gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)YUY2, framerate=(fraction)30/1’ ! nvvidconv ! ‘video/x-raw, format=(string)I420’ ! xvimagesink -ev

But it have no preview, it reports can’t handle caps format YUY2.
I refer other topics, it say the nvv4l2camerasrc support UYVY default, I need to add my format YUY2 in nvv4l2camerasrc source code.
I compile the gst-nvv4l2camera source code, but failed: can’t find nvbufsurface.h
xxx@ubuntu:~/src/gst-nvv4l2camera$ make
g++ -c gstnvv4l2camerasrc.cpp -fPIC -DEXPLICITLY_ADDED=1 -DGETTEXT_PACKAGE=1 -DHAVE_LIBV4L2=1 -DUSE_V4L2_TARGET_NV=1 pkg-config --cflags gstreamer-1.0 gstreamer-base-1.0 gstreamer-video-1.0 gstreamer-allocators-1.0 glib-2.0 libv4l2 -I./ -I…/ -o gstnvv4l2camerasrc.o
gstnvv4l2camerasrc.cpp:50:10: fatal error: nvbufsurface.h: No such file or directory
#include “nvbufsurface.h”
^~~~~~~~~~~~~~~~
compilation terminated.
Makefile:67: recipe for target ‘gstnvv4l2camerasrc.o’ failed
make: *** [gstnvv4l2camerasrc.o] Error 1

How can i resolve this error?

Other infomation:
1.My camera image format is YUV422
2. L4T version is R32.4.3

Have you verify the v4l2src?

I don’t know what u mean, I have try the two ways。

  1. use v4l2src:
    gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, width=(int)1920, height=(int)1080, format=(string)YUY2, framerate=(fraction)30/1’ ! xvimagesink -ev
    It runs okay and have a preview.

  2. compile v4l2src
    I try to compile the libv4l2 and libv4lconvert, and they can compile sucess. But i find the source code don’t included the nvbufsurface.h.

I want change to use nvv4l2camerasrc. because of , the nvv4l2camerasrc use x-raw(NVMM) is more efficient then v4l2src x-raw. It helpfull for my hardware encoding work.

OK, It’s my bad I miss understand the question. Will check the compiler error as soon as possible.

Please download the deepstream SDK to get the include file.

Yes, I find nvbufsurface.h in deepstream SDK. And i add it to nvv4l2camerasrc source code, compile sucess!
Now, after add my format YUY2, the nvv4l2camerasrc runs well with my camera, can preview now.
Thinks!

Excuse me. Recently I do the same work to expand the plugin, but I have no idea how to do this. Could you share the idea or the code about how to make nvv4l2camerasrc support more formats, such as YUYV. Thank you !

I think u need pay for it. :)