Opened 9 months ago

Last modified 9 months ago

#6998 new enhancement

[Feature Request] add IYU2 and Y410 to DShow/FFMPEG

Reported by: XxJonathXx Owned by:
Priority: wish Component: avdevice
Version: git-master Keywords: dshow
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Hello,

I have a Magewell Pro Capture HDMI 4K Plus and it supports IYU2 (yuv 444 8-bit) and Y410 (yuv 444 10-bit), however, neither DShow nor FFMPEG does support them.

IYU2 = 0x32555949
Y410 = 0x30313459

I did try adding them on my own (in dshow.c I added the case for each and made IYU2 recognize as yuv444p and Y410 as yuv444p10le. Within the raw.c I have added the corresponding tags)

dshow.c

	case 0x32555949:
		return AV_PIX_FMT_YUV444P;
	case 0x30313459:
		return AV_PIX_FMT_YUV444P10BE;

raw.c

    { AV_PIX_FMT_YUV444P,     MKTAG('I', 'Y', 'U', '2') },
    { AV_PIX_FMT_YUV444P10LE, MKTAG('Y', '4', '1', '0') },

For IYU2 it actually worked. DShow recognized it as a pixel format for my capture card, and I was able to select it for recording. However, the recorded image is distorted (wrong colors) and it looks as if it is zoomed in. I assume that I either did something wrong, as in applying the wrong formats, or something else has to be added for it to work.
Unfortunately I am not knowledgable enough to do it on my own.

About Y410: While it was shown as a pixel format for my capture card via DShow, I was also able to select it, however, I did get the following error message:
{{{[rawvideo @ 000002b1a22c2680] Invalid buffer size, packet size 14745600 < expected frame_size 22118400
Error while decoding stream #0:0: Invalid argument}}}

Thanks in advance.

Attachments (1)

IYU2.jpg (1.6 MB) - added by XxJonathXx 9 months ago.
Image when recording with IYU2 via FFMPEG with the things I set up.

Download all attachments as: .zip

Change History (3)

Changed 9 months ago by XxJonathXx

Image when recording with IYU2 via FFMPEG with the things I set up.

comment:1 Changed 9 months ago by cehoyos

  • Component changed from ffmpeg to avdevice
  • Keywords ffmpeg pixel_format yuv444p removed
  • Priority changed from normal to wish
  • Version changed from unspecified to git-master

AV_PIX_FMT_YUV444P is planar while IYU2 is likely packed, so this is not completely trivial.

comment:2 Changed 9 months ago by XxJonathXx

Yes, according to this website (https://www.fourcc.org/yuv.php) IYU2 is packed. I wasn't sure whether this was the issue or not.

In this case it is not as useful for me as I had hoped. My idea was to use scale-npp to output yuv444p and I thought IYU2 is yuv444p, so the input would have the same pixel format as the output, which would have better performance than having the input pixel format in bgr24 and then converting it to yuv444p.

Thanks for clarification.

Last edited 9 months ago by XxJonathXx (previous) (diff)
Note: See TracTickets for help on using tickets.