Opened 7 years ago
Last modified 2 years ago
#6998 open enhancement
[Feature Request] add IYU2 and Y410 to DShow/FFMPEG
Reported by: | Jan Reimer | Owned by: | |
---|---|---|---|
Priority: | wish | Component: | avdevice |
Version: | git-master | Keywords: | dshow |
Cc: | Diederick Niehorster | 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)
Change History (11)
by , 7 years ago
comment:1 by , 7 years ago
Component: | ffmpeg → avdevice |
---|---|
Keywords: | ffmpeg pixel_format yuv444p removed |
Priority: | normal → wish |
Version: | unspecified → git-master |
AV_PIX_FMT_YUV444P is planar while IYU2 is likely packed, so this is not completely trivial.
comment:2 by , 7 years ago
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.
comment:3 by , 4 years ago
Cc: | added |
---|
comment:4 by , 4 years ago
Y410 is here: https://patchwork.ffmpeg.org/project/ffmpeg/patch/1575470709-8516-1-git-send-email-linjie.fu@intel.com/
IYU2 is here: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/dc1394/gstdc1394src.c#L967
comment:5 by , 3 years ago
Status: | new → open |
---|
Okay, WTF. I just found out that these patches are not applied: https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=527
So, qsvdec it works, nvdec, it works, and yet d3d11 and dxva are not there! See also code in MPC that applies these patches (BE, not HC, LOL), it works! LOL! https://github.com/Aleksoid1978/MPC-BE/commit/685e76b023b90a9a06c9d647b7a3d6c650798251
https://github.com/Aleksoid1978/MPC-BE/commit/31be924604af23801e5329e54b9d5098f6be10d0
Really, wow.
comment:6 by , 3 years ago
We also need NV16 and NV61 (422 8 bit, so 2/3 from 24 bit, so 16 bits) patch for NV16 is here https://patchwork.ffmpeg.org/project/ffmpeg/patch/20220601203337.1116134-1-matthieu.bouron@gmail.com/ NV61 does exist here: https://github.com/NVIDIA/open-gpu-kernel-modules/blob/d8f3bcff924776518f1e63286537c3cf365289ac/kernel-open/nvidia-drm/nvidia-drm-format.c#L67
NV30 for 10 bit 444, so 30 bits (it does exist, google it)
https://github.com/retro98boy/batocera-tn3399_v3/blob/a119f11f4317ffd589ea961c069cbbce9f215be4/board/batocera/rockchip/rk3288/linux_patches/linux-0021-drm-from-list.patch#L6
We also need P012 as we can see from Nvidia linux driver around firmware OS source code, it also exist, somehow we have P012 in our internal assembler symbols (https://github.com/FFmpeg/FFmpeg/search?q=p012&type=code). https://github.com/NVIDIA/open-gpu-kernel-modules/search?q=p012
comment:9 by , 2 years ago
Y216, Y410, and Y416 will be added here. https://patchwork.ffmpeg.org/project/ffmpeg/patch/20220813211821.14916-2-philipl@overt.org/
comment:10 by , 2 years ago
P012 will be added here. https://patchwork.ffmpeg.org/project/ffmpeg/patch/20220826021736.355903-2-philipl@overt.org/
Image when recording with IYU2 via FFMPEG with the things I set up.