Ffmpeg pixel conversion

Hi, I’m taking up an old project from some former colleagues. Trying to get an image from an Allied Vision 1800 c-319 camera. The camera is connected to a Jetson AGX flashed with a yocto build.

v4l2-ctl --list-formats-ext

produces the following output:

ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture

	[0]: 'TP31' (0x31 MIPI DATATYPE)
		Size: Discrete 1536x1264
			Interval: Discrete 0.033s (30.000 fps)
	[1]: 'GREY' (8-bit Greyscale)
		Size: Discrete 1536x1264
			Interval: Discrete 0.033s (30.000 fps)
	[2]: 'RGGB' (8-bit Bayer RGRG/GBGB)
		Size: Discrete 1536x1264
			Interval: Discrete 0.033s (30.000 fps)
	[3]: 'JXY0' (10-bit/16-bit Greyscale)
		Size: Discrete 1536x1264
			Interval: Discrete 0.033s (30.000 fps)
	[4]: 'JXR0' (10-bit/16-bit Bayer RGRG/GBGB)
		Size: Discrete 1536x1264
			Interval: Discrete 0.033s (30.000 fps)
	[5]: 'Y12 ' (12-bit Greyscale)
		Size: Discrete 1536x1264
			Interval: Discrete 0.033s (30.000 fps)
	[6]: 'Y16 ' (16-bit Greyscale)
		Size: Discrete 1536x1264
			Interval: Discrete 0.033s (30.000 fps)
	[7]: 'JXY2' (12-bit/16-bit Greyscale)
		Size: Discrete 1536x1264
			Interval: Discrete 0.033s (30.000 fps)
	[8]: 'JXR2' (12-bit/16-bit Bayer RGRG/GBGB)
		Size: Discrete 1536x1264
			Interval: Discrete 0.033s (30.000 fps)
	[9]: 'BX24' (32-bit XRGB 8-8-8-8)
		Size: Discrete 1536x1264
			Interval: Discrete 0.033s (30.000 fps)
	[10]: 'XR24' (32-bit BGRX 8-8-8-8)
		Size: Discrete 1536x1264
			Interval: Discrete 0.033s (30.000 fps)
	[11]: 'VYUY' (VYUY 4:2:2)
		Size: Discrete 1536x1264
			Interval: Discrete 0.033s (30.000 fps)

I then use the following to get one frame:

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1536,height=1264,pixelformat=BX24 --stream-mmap --stream-count=1 --stream-to=img.raw

I now move the image to my host computer using scp. On my host computer I now have “img.raw” with a size of 7.5M. So far so good.

Problem is, I have no idea how to convert it so I’m able to view that image.

I have this so far:

ffmpeg -f rawvideo -pix_fmt yuyv422 -s:v 1536x1264 -r 30 -i img.raw -c:v v210 out.jpeg

but it produces the image with some weird colors.

Any help appreciated!