YUV camera(5.4M) preview issue

Hello,
I have a YUV gmsl2 camera and have porting the driver, W x H is 2880x1860.
I use gst to preview on HDMI screen, but the display ls not normally.
My gst pipeline:
gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! ‘video/x-raw(memory:NVMM), width=(int)2880, height=(int)1860, framerate=(fraction)30/1’ ! nvvidconv ! ‘video/x-raw, format=(string)I420’ ! xvimagesink -ev
It is same issue when i use v4l2src pipeline.


other info:

  1. I have ever bring up my YUV(1920x1080) gmsl2 camera use this pipeline, it previews well on screen.
  2. I use v4l2-ctl to capture the YUV image, these image is well and can display normal.

Why this happen? Does the gst pipeline not support this resolution 2880x1860?

Try below command

v4l2-ctl --set-ctrl preferred_stride=2912 and 2944

After this try, get no echo. And the issue no change.

Could you try 4096?

Do u mean use this command, then do the gst pipeline? 4096 also no change.

Could you try 3904 again for me.

Thanks

Also no change. My pixel format is YUYV-8.

Any other suggestion?

You you help to try 3072 due to 256 alignment.

Also nothing change.
Addition info for u reference , I use the v4l2src plugin, the previewer display well. (Have not do the preferred_stride command)
pipeline with v4l2src :
gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, width=(int)2880, height=(int)1860, format=(string)YUY2, framerate=(fraction)30/1’ ! xvimagesink -ev

How about nvoverlaysink?

With nvoverlaysink, v4l2src preview well, but nvv4l2camerasrc occur the same issue.
I also try to recoard mp4 with h264 encode, then play the mp4, the same result as above: v4l2src is well , but nvv4l2camerasrc fail.
So this issue shoule not about the appsink, maybe the src plugin cause?

Could you try below patch.

Yeah, In fact, my NVv4L2Camerasrc plug-in has already merged this patch to support the YUYV format. I have done this in my another topic ever.
Gst-nvv4l2camera compile error: can’t find nvbufsurface.h

Now skip this, we need to think in other ways.

Hi,
Please try this pipeline and check if preview is good:

$ gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=(int)2880, height=(int)1860, framerate=(fraction)30/1' ! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)I420' ! nv3dsink

pipeline error,
erroneous pipeline: could not link nvvconv0 to nv3dsink0, nv3dsink0 can’t handle caps video/x-raw, format=(string)I420
I fixed it with (memory:NVMM), and preview is good.
gst-launch-1.0 v4l2src device=/dev/video0 ! ‘video/x-raw, width=(int)2880, height=(int)1860, framerate=(fraction)30/1’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), format=(string)I420’ ! nv3dsink

Hi,
There is constraint in data alignment, for width = 2880, it is aligned to pitch = 2944. Please check if your source can output width = 2944 or 2816. If not, you would need to capture frame data to CPU buffer first and then copy to NvBuffer. The buffer copy may impact performance.

Yes, i think so. Thinks!
So, NvBuffer should be 256 Bytes alignment, and the image line-length should on this rule.

1 Like