Why v4l2src gstreamer plugin can take 'YV12' pixelformat?

Hi

I am working with Xavier L4T R31.1.

nvidia@jetson:~$ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=<b>YUY2</b>,framerate=60/1,width=1280,hight=720 ! fakesink

works fine

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:01.915851788
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

But

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=<b>YV12</b>,framerate=60/1,width=1280,height=720 ! fakesink

throws error

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
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)
Execution ended after 0:00:00.000106436
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

I even checked running the second pipeline in normal intel PC, it works fine. I mean both YUV2 and YV12 work fine in normal PC with same USB camera.

How can I make YV12 working in Xavier?

Could you check the device cap by v4l2-ctl --list-formats-ext and gst-inspect-1.0 v4l2src

nvidia@jetson:~/jai$ v4l2-ctl --list-formats-ext
v4l2-ctl: /usr/lib/aarch64-linux-gnu/libjpeg.so.8: no version information available (required by /usr/lib/aarch64-linux-gnu/libv4lconvert.so.0)
ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'MJPG' (compressed)
	Name        : Motion-JPEG
		Size: Discrete 1920x1080
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.017s (60.000 fps)

	Index       : 1
	Type        : Video Capture
	Pixel Format: 'YUYV'
	Name        : YUYV 4:2:2
		Size: Discrete 1920x1080
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.017s (60.000 fps)
nvidia@jetson:~/jai$ gst-inspect-1.0 v4l2src
  video/x-raw
        format: { (string)RGB16, (string)BGR, (string)RGB, (string)GRAY8, (string)GRAY16_LE,
        (string)GRAY16_BE, (string)YVU9, (string)<b>YV12</b>, (string)YUY2, (string)YVYU, (string)UYVY,
        (string)Y42B, (string)Y41B, (string)YUV9, (string)NV12_64Z32, (string)NV24, (string)NV61,
        (string)NV16, (string)NV21, (string)NV12, (string)I420, (string)BGRA, (string)BGRx, (string)ARGB,
        (string)xRGB, (string)BGR15, (string)RGB15 }

Yes, I know YV12 is not there in ‘v4l2-ctl --list-formats-ext’. But when I connect the same camera in a normal intel computer and use below cmd, it works fine.

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YV12,framerate=60/1,width=1280,height=720 ! fakesink

What’s the output of this command on the PC?

v4l2-ctl --list-formats-ext

As you tell this device didn’t support YV12 why did you use this pipeline?
It could be the PC version v4l2src or v4l2 framework handle the error. Could you try the PC with k4.9 to confirm it.

On PC it’s the same as on Jetson.

jai@jai:~$ v4l2-ctl -d1 --list-formats-ext     # On PC
ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'MJPG' (compressed)
	Name        : Motion-JPEG
		Size: Discrete 1920x1080
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.017s (60.000 fps)

	Index       : 1
	Type        : Video Capture
	Pixel Format: 'YUYV'
	Name        : YUYV 4:2:2
		Size: Discrete 1920x1080
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.017s (60.000 fps)

Actually I am also querying gstreamer portal for this issue.
http://gstreamer-devel.966125.n4.nabble.com/How-and-why-v4l2src-able-to-take-YV12-format-td4692602.html
I am hoping to have a satisfying answer :)

You may need to trace the source of the v4l2src to know the detail.
I believe it could be the v4l2src auto handle the format that driver not support.