How to make property pipiline for nvv4l2camerasrc YUY2?

Hi NV_Team,

I have an V4L2 camera (YUV 4:2:2) → YUYV.
If I use this command to open this camera to preview (display green screen not correct color)

nvidia@xavier:~$ gst-launch-1.0 -ev v4l2src device=/dev/video0 ! 'video/x-raw,format=YUY2,width=1280,height=720' ! videoconvert ! fpsdisplaysink video-sink=xvimagesink sync=false

if change to this command is display color correct.

nvidia@xavier:~$ gst-launch-1.0 -ev v4l2src device=/dev/video0 ! rawvideoparse format=5 width=1280 height=720 ! videoconvert ! fpsdisplaysink video-sink=xvimagesink sync=false 

I use nvv4l2camerasrc to replace v4l2src , display still green screen . (I have modified libgstnvv4l2camerasrc.so to support YUYV)

nvidia@xavier:~$ gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! 'video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=(fraction)30/1, format=(string)YUY2' ! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)NV12' !  nv3dsink -e

Thanks so much.

It’s USB camera?
What the v4l2-ctl --list-formats-ext shows.

Also did you mean apply below patch still have problem?

Hi ShaneCCC,

Not USB Camera, it’s a GMSL Camera (YUYV, V4L2)

nvidia@xavier:~$ v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'YUYV'
	Name        : YUYV 4:2:2
		Size: Discrete 1280x720
			Interval: Discrete 0.033s (30.000 fps)
nvidia@xavier:~$ v4l2-ctl --all
Driver Info (not using libv4l2):
	Driver name   : tegra-video
	Card type     : vi-output, ar0147yuv 30-006d
	Bus info      : platform:15c10000.vi:0
	Driver version: 4.9.201
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format
Priority: 2
Video input : 0 (Camera 0: ok)
Format Video Capture:
	Width/Height      : 1280/720
	Pixel Format      : 'YUYV'
	Field             : None
	Bytes per Line    : 2560
	Size Image        : 1843200
	Colorspace        : sRGB
	Transfer Function : Default (maps to sRGB)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Limited Range)
	Flags             : 

I have modified “nvv4l2camerasrc” to YUY2 but the screen is still not correct color space.

Does rawvideoparse help on the issue? Or remove the ‘video/x-raw,format=YUY2,width=1280,height=720’ help on it?

Hi ShaneCCC,

rawvideoparse display color correct.

gst-launch-1.0 -ev v4l2src device=/dev/video0 ! rawvideoparse format=5 width=1280 height=720 ! videoconvert ! fpsdisplaysink video-sink=xvimagesink sync=false 

Remove ‘video/x-raw,format=YUY2,width=1280,height=720’ still display color not correct the same as before.

gst-launch-1.0 -ev v4l2src device=/dev/video0 ! videoconvert ! fpsdisplaysink video-sink=xvimagesink sync=false

Could you check get the raw file from v4l2-ctl to check it.

v4l2-ctl --set-fmt-video=width=1280,height=720,pixelformat=YUYV --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=t.raw -d /dev/video0 

Hi ShaneCCC,

Get the raw file:

t.raw (1.8 MB)

The raw file looks like UYVY instead YUYV

Hi ShaneCCC,

Okay, I will contact with the Camera vendor to check again.
Can you share your YUV tool ?

Thanks again.

Check this link.

http://datahammer.de/

Hi ShaneCCC,

Thanks.

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