# How to make property pipiline for nvv4l2camerasrc YUY2?

**URL:** <https://forums.developer.nvidia.com/t/how-to-make-property-pipiline-for-nvv4l2camerasrc-yuy2/192856>\
**Category:** Jetson AGX Xavier\
**Tags:** camera\
**Created:** [October 23, 2021, 8:21am UTC](https://forums.developer.nvidia.com/t/how-to-make-property-pipiline-for-nvv4l2camerasrc-yuy2/192856 "2021-10-23T08:21:03Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luna2020](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/luna2020/32/12948_2.png) [@Luna2020](https://forums.developer.nvidia.com/u/Luna2020)\
**Post date:** [October 23, 2021, 8:21am UTC](https://forums.developer.nvidia.com/t/how-to-make-property-pipiline-for-nvv4l2camerasrc-yuy2/192856/1 "2021-10-23T08:21:03Z")

</div>

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)

```auto
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.

```auto
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)

```auto
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

```

 ![Green display](https://global.discourse-cdn.com/nvidia/original/3X/f/4/f40981f8ef3d85cdef4f79af44b4a5ebd79f7bde.jpeg)

Thanks so much.

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [October 26, 2021, 3:16pm UTC](https://forums.developer.nvidia.com/t/how-to-make-property-pipiline-for-nvv4l2camerasrc-yuy2/192856/3 "2021-10-26T15:16:56Z")

</div>

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

Also did you mean apply below patch still have problem?

> [@Macrosilicon USB](https://forums.developer.nvidia.com/t/macrosilicon-usb/157777/5):
>
> Hi, It only accepts UYVY in nvv4l2camerasrc. For launching source with YUYV(YUY2) format, you would need to customize the plugin. It it open source in [https://developer.nvidia.com/embedded/linux-tegra](https://developer.nvidia.com/embedded/linux-tegra) L4T Driver Package (BSP) Sources Please download it and take a look. The implementation is based on jetson\_multiemdia\_api. For YUYV, please apply the patch: diff --git a/gst-nvv4l2camera/gstnvv4l2camerasrc.cpp b/gst-nvv4l2camera/gstnvv4l2camerasrc.cpp index 26ad70c..ad0a512 100644 --- a/gst-nv…

---

<div class="post-metadata">

**Author:** ![Luna2020](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/luna2020/32/12948_2.png) [@Luna2020](https://forums.developer.nvidia.com/u/Luna2020)\
**Post date:** [October 28, 2021, 2:48am UTC](https://forums.developer.nvidia.com/t/how-to-make-property-pipiline-for-nvv4l2camerasrc-yuy2/192856/4 "2021-10-28T02:48:35Z")

</div>

Hi ShaneCCC,

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

```auto
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)

```

```auto
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 : 

```

---

<div class="post-metadata">

**Author:** ![Luna2020](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/luna2020/32/12948_2.png) [@Luna2020](https://forums.developer.nvidia.com/u/Luna2020)\
**Post date:** [October 28, 2021, 2:49am UTC](https://forums.developer.nvidia.com/t/how-to-make-property-pipiline-for-nvv4l2camerasrc-yuy2/192856/5 "2021-10-28T02:49:42Z")

</div>

> [@Luna2020](#):
>
> Hi ShaneCCC,

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

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [October 28, 2021, 4:14am UTC](https://forums.developer.nvidia.com/t/how-to-make-property-pipiline-for-nvv4l2camerasrc-yuy2/192856/6 "2021-10-28T04:14:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Luna2020](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/luna2020/32/12948_2.png) [@Luna2020](https://forums.developer.nvidia.com/u/Luna2020)\
**Post date:** [October 28, 2021, 4:51am UTC](https://forums.developer.nvidia.com/t/how-to-make-property-pipiline-for-nvv4l2camerasrc-yuy2/192856/7 "2021-10-28T04:51:27Z")

</div>

Hi ShaneCCC,

rawvideoparse display color correct.

```auto
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.

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

```

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [October 28, 2021, 6:25am UTC](https://forums.developer.nvidia.com/t/how-to-make-property-pipiline-for-nvv4l2camerasrc-yuy2/192856/8 "2021-10-28T06:25:36Z")

</div>

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

```auto
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 

```

---

<div class="post-metadata">

**Author:** ![Luna2020](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/luna2020/32/12948_2.png) [@Luna2020](https://forums.developer.nvidia.com/u/Luna2020)\
**Post date:** [October 28, 2021, 7:35am UTC](https://forums.developer.nvidia.com/t/how-to-make-property-pipiline-for-nvv4l2camerasrc-yuy2/192856/9 "2021-10-28T07:35:29Z")

</div>

Hi ShaneCCC,

Get the raw file:

[t.raw](https://forums.developer.nvidia.com/uploads/short-url/qlUpO8VqCZXJEyMrLnpm8aUiVM0.raw) (1.8 MB)

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [October 28, 2021, 10:08am UTC](https://forums.developer.nvidia.com/t/how-to-make-property-pipiline-for-nvv4l2camerasrc-yuy2/192856/10 "2021-10-28T10:08:48Z")

</div>

The raw file looks like UYVY instead YUYV

 ![t](https://global.discourse-cdn.com/nvidia/original/3X/9/3/93784901095f420e4bb6fd73e606c156562638dc.jpeg)

---

<div class="post-metadata">

**Author:** ![Luna2020](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/luna2020/32/12948_2.png) [@Luna2020](https://forums.developer.nvidia.com/u/Luna2020)\
**Post date:** [October 29, 2021, 1:55am UTC](https://forums.developer.nvidia.com/t/how-to-make-property-pipiline-for-nvv4l2camerasrc-yuy2/192856/11 "2021-10-29T01:55:31Z")

</div>

Hi ShaneCCC，

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

Thanks again.

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [October 29, 2021, 3:28am UTC](https://forums.developer.nvidia.com/t/how-to-make-property-pipiline-for-nvv4l2camerasrc-yuy2/192856/12 "2021-10-29T03:28:31Z")

</div>

Check this link.

[http://datahammer.de/](http://datahammer.de/)

---

<div class="post-metadata">

**Author:** ![Luna2020](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/luna2020/32/12948_2.png) [@Luna2020](https://forums.developer.nvidia.com/u/Luna2020)\
**Post date:** [October 29, 2021, 3:41am UTC](https://forums.developer.nvidia.com/t/how-to-make-property-pipiline-for-nvv4l2camerasrc-yuy2/192856/13 "2021-10-29T03:41:00Z")

</div>

Hi ShaneCCC,

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [November 17, 2021, 6:32am UTC](https://forums.developer.nvidia.com/t/how-to-make-property-pipiline-for-nvv4l2camerasrc-yuy2/192856/15 "2021-11-17T06:32:41Z")

</div>

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