Building Gstreamer newly

I have been using snapshot by linaro:
https://snapshots.linaro.org/96boards/dragonboard820c/linaro/debian/362/

And the gstreamer version in this was: gst-launch-1.0 version 1.14.4

While trying the h26x encoding in video capture it gave error :

$ gst-launch-1.0 -e v4l2src device=/dev/video0 ! video/x-raw,format=UYVY,width=1920,height=1080,framerate=30/1 ! v4l2h264enc ! h264parse ! mp4mux ! filesink location=video.mp4

WARNING: erroneous pipeline: could not link v4l2src0 to v4l2h264enc0, v4l2h264enc0 can’t handle caps video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080, framerate=(fraction)30/1

$ gst-launch-1.0 -e v4l2src device=/dev/video0 ! video/x-raw,format=UYVY ! v4l2h264enc ! h264parse ! mp4mux ! filesink location=video.mp4

WARNING: erroneous pipeline: could not link v4l2src0 to v4l2h264enc0, v4l2h264enc0 can’t handle caps video/x-raw, format=(string)UYVY

$ gst-launch-1.0 -e v4l2src device=/dev/video0 ! video/x-raw ! v4l2h264enc ! h264parse ! mp4mux ! filesink location=video.mp4
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
EOS on shutdown enabled – waiting for EOS after Error
Waiting for EOS…
^Chandling interrupt.
Interrupt: Stopping pipeline …
Interrupt while waiting for EOS - stopping pipeline…
Execution ended after 0:00:06.550610313
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

So I wished to rebuild Gstreamer…
Thanks in advance for any help in this issue…

v4l2h264enc element use hardware encoder (venus) which AFAIR does not support ‘UYVY’ input (gst-inspect-1.0 v4l2h264enc), so either try to get supported ‘NV12’ format from the camera sensor or use add a ‘videoconvert’ element before ‘v4l2h264enc’.