Opened 22 months ago

Last modified 5 months ago

#8454 open enhancement

No PixelFormatTag for P010 (fourcc 0x30313050)

Reported by: pheedbaq3 Owned by:
Priority: wish Component: avdevice
Version: git-master Keywords: dshow
Cc: pheedbaq@outlook.com, Diederick Niehorster Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Usage:
Capturing from AVerMedia HD Capture GC573 in P010 pixel format.

Problem:
The P010 pixel_format that the capture card uses is not recognized ("unknown compression type"). No pixel format tag exists for fourcc code 0x30313050 (010P) in ffmpeg\libavcodec\raw.c.

Command Used:
ffmpeg -f dshow -list_options true -i video="AVerMedia HD Capture GC573 1"

Console Output:
ffmpeg -v 9 -loglevel 99 -f dshow -list_options true -i video="AVerMedia HD Capture GC573 1"
ffmpeg version git-2019-12-29-e20c6d9 Copyright (c) 2000-2019 the FFmpeg developers

built with gcc 9.2.1 (GCC) 20191125
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil 56. 38.100 / 56. 38.100
libavcodec 58. 65.100 / 58. 65.100
libavformat 58. 35.101 / 58. 35.101
libavdevice 58. 9.101 / 58. 9.101
libavfilter 7. 70.100 / 7. 70.100
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100

Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'dshow'.
Reading option '-list_options' ... matched as AVOption 'list_options' with argument 'true'.
Reading option '-i' ... matched as input url with argument 'video=AVerMedia HD Capture GC573 1'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Successfully parsed a group of options.
Parsing a group of options: input url video=AVerMedia HD Capture GC573 1.
Applying option f (force format) with argument dshow.
Successfully parsed a group of options.
Opening an input file: video=AVerMedia HD Capture GC573 1.
[dshow @ 000001c463ac8a40] DirectShow video device options (from video devices)
[dshow @ 000001c463ac8a40] Pin "Capture" (alternative pin name "0")
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=1920x1080 fps=24 max s=1920x1080 fps=240.004
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=640x480 fps=59.9402 max s=640x480 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=720x480 fps=59.9402 max s=720x480 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=720x576 fps=50 max s=720x576 fps=50
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=800x600 fps=60.0002 max s=800x600 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=1024x768 fps=60.0002 max s=1024x768 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=1280x720 fps=50 max s=1280x720 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=1280x768 fps=60.0002 max s=1280x768 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=1280x800 fps=60.0002 max s=1280x800 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=1280x1024 fps=60.0002 max s=1280x1024 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=1360x768 fps=60.0002 max s=1360x768 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=1440x900 fps=60.0002 max s=1440x900 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=1680x1050 fps=60.0002 max s=1680x1050 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=1920x1080 fps=24 max s=1920x1080 fps=240.004
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=2560x1080 fps=60.0002 max s=2560x1080 fps=144.001
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=2560x1440 fps=59.9402 max s=2560x1440 fps=144.001
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=3440x1440 fps=50 max s=3440x1440 fps=100
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=3840x2160 fps=24 max s=3840x2160 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=yuyv422 min s=1920x1080 fps=24 max s=1920x1080 fps=240.004
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=1920x1080 fps=24 max s=1920x1080 fps=240.004
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=640x480 fps=59.9402 max s=640x480 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=720x480 fps=59.9402 max s=720x480 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=720x576 fps=50 max s=720x576 fps=50
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=800x600 fps=60.0002 max s=800x600 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=1024x768 fps=60.0002 max s=1024x768 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=1280x720 fps=50 max s=1280x720 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=1280x768 fps=60.0002 max s=1280x768 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=1280x800 fps=60.0002 max s=1280x800 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=1280x1024 fps=60.0002 max s=1280x1024 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=1360x768 fps=60.0002 max s=1360x768 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=1440x900 fps=60.0002 max s=1440x900 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=1680x1050 fps=60.0002 max s=1680x1050 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=1920x1080 fps=24 max s=1920x1080 fps=240.004
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=2560x1080 fps=60.0002 max s=2560x1080 fps=144.001
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=2560x1440 fps=59.9402 max s=2560x1440 fps=144.001
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=3440x1440 fps=50 max s=3440x1440 fps=100
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=3840x2160 fps=24 max s=3840x2160 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=nv12 min s=1920x1080 fps=24 max s=1920x1080 fps=240.004
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=1920x1080 fps=24 max s=1920x1080 fps=240.004
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=640x480 fps=59.9402 max s=640x480 fps=60.0002
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=720x480 fps=59.9402 max s=720x480 fps=60.0002
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=720x576 fps=50 max s=720x576 fps=50
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=800x600 fps=60.0002 max s=800x600 fps=60.0002
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=1024x768 fps=60.0002 max s=1024x768 fps=60.0002
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=1280x720 fps=50 max s=1280x720 fps=60.0002
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=1280x768 fps=60.0002 max s=1280x768 fps=60.0002
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=1280x800 fps=60.0002 max s=1280x800 fps=60.0002
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=1280x1024 fps=60.0002 max s=1280x1024 fps=60.0002
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=1360x768 fps=60.0002 max s=1360x768 fps=60.0002
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=1440x900 fps=60.0002 max s=1440x900 fps=60.0002
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=1680x1050 fps=60.0002 max s=1680x1050 fps=60.0002
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=1920x1080 fps=24 max s=1920x1080 fps=240.004
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=2560x1080 fps=60.0002 max s=2560x1080 fps=144.001
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=2560x1440 fps=59.9402 max s=2560x1440 fps=144.001
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=3440x1440 fps=50 max s=3440x1440 fps=100
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=3840x2160 fps=24 max s=3840x2160 fps=60.0002
[dshow @ 000001c463ac8a40] unknown compression type 0x30313050 min s=1920x1080 fps=24 max s=1920x1080 fps=240.004
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=1920x1080 fps=24 max s=1920x1080 fps=240.004
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=640x480 fps=59.9402 max s=640x480 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=720x480 fps=59.9402 max s=720x480 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=720x576 fps=50 max s=720x576 fps=50
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=800x600 fps=60.0002 max s=800x600 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=1024x768 fps=60.0002 max s=1024x768 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=1280x720 fps=50 max s=1280x720 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=1280x768 fps=60.0002 max s=1280x768 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=1280x800 fps=60.0002 max s=1280x800 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=1280x1024 fps=60.0002 max s=1280x1024 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=1360x768 fps=60.0002 max s=1360x768 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=1440x900 fps=60.0002 max s=1440x900 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=1680x1050 fps=60.0002 max s=1680x1050 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=1920x1080 fps=24 max s=1920x1080 fps=240.004
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=2560x1080 fps=60.0002 max s=2560x1080 fps=144.001
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=2560x1440 fps=59.9402 max s=2560x1440 fps=120
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=3440x1440 fps=50 max s=3440x1440 fps=100
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=3840x2160 fps=24 max s=3840x2160 fps=60.0002
[dshow @ 000001c463ac8a40] pixel_format=bgr24 min s=1920x1080 fps=24 max s=1920x1080 fps=240.004
[dshow @ 000001c463ac8a40] Pin "Audio Mixer" (alternative pin name "1")
[dshow @ 000001c463ac8a40] Pin "Audio" (alternative pin name "2")
[dshow @ 000001c463ac8a40] Selecting pin Capture on video

Change History (44)

comment:1 by pheedbaq3, 22 months ago

Cc: pheedbaq@outlook.com added

comment:2 by pheedbaq3, 22 months ago

Summary: No PixelFormatTag for 010P (0x30313050)No PixelFormatTag for P010 (fourcc 0x30313050)

comment:3 by Carl Eugen Hoyos, 22 months ago

Component: avcodecavdevice
Keywords: dshow added
Priority: normalwish
Type: defectenhancement
Version: unspecifiedgit-master

Please test this patch:

diff --git a/libavcodec/raw.c b/libavcodec/raw.c
index b6fb91c1c6..6052f18983 100644
--- a/libavcodec/raw.c
+++ b/libavcodec/raw.c
@@ -72,6 +72,7 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = {
     { AV_PIX_FMT_GRAY8,   MKTAG('G', 'R', 'E', 'Y') },
     { AV_PIX_FMT_NV12,    MKTAG('N', 'V', '1', '2') },
     { AV_PIX_FMT_NV21,    MKTAG('N', 'V', '2', '1') },
+    { AV_PIX_FMT_P010LE,  MKTAG('P', '0', '1', '0') },
 
     /* nut */
     { AV_PIX_FMT_RGB555LE, MKTAG('R', 'G', 'B', 15) },
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index d7f5bd7069..e9aa8c21db 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -50,6 +50,8 @@ static enum AVPixelFormat dshow_pixfmt(DWORD biCompression, WORD biBitCount)
             case 32:
                 return AV_PIX_FMT_0RGB32;
         }
+    case 0x30313050:
+        return AV_PIX_FMT_P010LE;
     }
     return avpriv_find_pix_fmt(avpriv_get_raw_pix_fmt_tags(), biCompression); // all others
 }

comment:4 by pheedbaq3, 22 months ago

Awesome, thanks for the quick response. I didn't have an env + dependencies set up for this project yet (typically work in .Net), so that took a bit of time. The new executable recognizes p010 from the capture card. I only made the patch to raw.c, left off the patch to dshow.c, as the avpriv_find_pix_fmt func already spins through the list of pixel formats from raw.c looking for a fourcc match, so it wins by default :) Thanks!

For my testing, first captured raw video:
ffmpeg -hide_banner -y -f dshow -video_size 3840x2160 -pix_fmt p010 -r 30 -rtbufsize 2047.48M -i video="AVerMedia HD Capture GC573 1" -c:v copy d:\out.yuv

Then dumped into avi:
ffmpeg -f rawvideo -video_size 3840x2160 -pix_fmt p010 -rtbufsize 2047.48M -i d:\out.yuv -pix_fmt p010 -c:v magicyuv d:\out.avi

comment:5 by Carl Eugen Hoyos, 22 months ago

If you did not test my patch please send your patch - made with git format-patch - to the FFmpeg development mailing list.

in reply to:  5 ; comment:6 by Balling, 22 months ago

Replying to cehoyos:

If you did not test my patch please send your patch - made with git format-patch - to the FFmpeg development mailing list.

He meant he used only

diff --git a/libavcodec/raw.c b/libavcodec/raw.c
index b6fb91c1c6..6052f18983 100644
--- a/libavcodec/raw.c
+++ b/libavcodec/raw.c
@@ -72,6 +72,7 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = {
     { AV_PIX_FMT_GRAY8,   MKTAG('G', 'R', 'E', 'Y') },
     { AV_PIX_FMT_NV12,    MKTAG('N', 'V', '1', '2') },
     { AV_PIX_FMT_NV21,    MKTAG('N', 'V', '2', '1') },
+    { AV_PIX_FMT_P010LE,  MKTAG('P', '0', '1', '0') },
 
     /* nut */
     { AV_PIX_FMT_RGB555LE, MKTAG('R', 'G', 'B', 15) },

in reply to:  6 comment:7 by pheedbaq3, 22 months ago

Replying to Balling:

He meant he used only

diff --git a/libavcodec/raw.c b/libavcodec/raw.c
index b6fb91c1c6..6052f18983 100644
--- a/libavcodec/raw.c
+++ b/libavcodec/raw.c
@@ -72,6 +72,7 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = {
     { AV_PIX_FMT_GRAY8,   MKTAG('G', 'R', 'E', 'Y') },
     { AV_PIX_FMT_NV12,    MKTAG('N', 'V', '1', '2') },
     { AV_PIX_FMT_NV21,    MKTAG('N', 'V', '2', '1') },
+    { AV_PIX_FMT_P010LE,  MKTAG('P', '0', '1', '0') },
 
     /* nut */
     { AV_PIX_FMT_RGB555LE, MKTAG('R', 'G', 'B', 15) },

Correct, that's what I meant. Just the one line in raw.c. Still cehoyos code, just the first portion of the patch.

in reply to:  5 ; comment:8 by pheedbaq3, 21 months ago

Hi, I had tested your patch, and things seem to be working. However, I'm unable to submit the patch myself, as my Git for Windows does not have msmtp for git sendmail, and is otherwise not working, not sure what the issue is. Could you go ahead and submit your patch (or just the portion of it that applies to raw.c, see Balling's response)? Thanks.

Replying to cehoyos:

If you did not test my patch please send your patch - made with git format-patch - to the FFmpeg development mailing list.

in reply to:  8 ; comment:9 by Carl Eugen Hoyos, 21 months ago

Replying to pheedbaq3:

I'm unable to submit the patch myself, as my Git for Windows does not have msmtp for git sendmail

As said, use git format-patch.

in reply to:  9 ; comment:10 by pheedbaq3, 21 months ago

Replying to cehoyos:

Replying to pheedbaq3:

I'm unable to submit the patch myself, as my Git for Windows does not have msmtp for git sendmail

As said, use git format-patch.

... git format-patch does not send email, hence my need to use git send-mail, hence the dilemma because Git for Windows 2+ does not include msmtp, required by git send-mail in Windows... as said.

in reply to:  10 ; comment:11 by Carl Eugen Hoyos, 21 months ago

Replying to pheedbaq3:

Replying to cehoyos:

Replying to pheedbaq3:

I'm unable to submit the patch myself, as my Git for Windows does not have msmtp for git sendmail

As said, use git format-patch.

... git format-patch does not send email

No, it creates a file that you can use as attachment in an email sent from your favorite mail client.

in reply to:  11 ; comment:12 by pheedbaq3, 21 months ago

Replying to cehoyos:

Replying to pheedbaq3:

Replying to cehoyos:

Replying to pheedbaq3:

I'm unable to submit the patch myself, as my Git for Windows does not have msmtp for git sendmail

As said, use git format-patch.

... git format-patch does not send email

No, it creates a file that you can use as attachment in an email sent from your favorite mail client.

From the developer docs, "Submitting Patches":
"...If you cannot [use git send-mail], then send patches as base64-encoded attachments, so your patch is not trashed during transmission. Also ensure the correct mime type is used (text/x-diff or text/x-patch or at least text/plain)"
Not terribly conducive to "your favorite mail client" scenario since the avg mail client does not provide ways of ensuring those settings.

Just saying, I'm not part of the dev group, don't have the entire build environment, just trying to submit a one-line patch. Fairly innocuous... I thought.

I'll give it a shot with Outlook.

in reply to:  12 comment:13 by Carl Eugen Hoyos, 21 months ago

Replying to pheedbaq3:

Also ensure the correct mime type is used (text/x-diff or text/x-patch or at least text/plain)

Add .txt to the name of your patch file to ensure this.

in reply to:  12 ; comment:14 by Carl Eugen Hoyos, 21 months ago

Replying to pheedbaq3:

Just saying, I'm not part of the dev group, don't have the entire build environment

That's indeed a problem as your change breaks fate and therefore cannot be committed as-is.

in reply to:  14 ; comment:15 by pheedbaq3, 21 months ago

Replying to cehoyos:

Replying to pheedbaq3:

Just saying, I'm not part of the dev group, don't have the entire build environment

That's indeed a problem as your change breaks fate and therefore cannot be committed as-is.

Not sure what you mean by "breaks fate"?

in reply to:  15 ; comment:16 by Carl Eugen Hoyos, 21 months ago

Replying to pheedbaq3:

Replying to cehoyos:

Replying to pheedbaq3:

Just saying, I'm not part of the dev group, don't have the entire build environment

That's indeed a problem as your change breaks fate and therefore cannot be committed as-is.

Not sure what you mean by "breaks fate"?

FFmpeg's self test is called fate, you run it with make fate which is sufficient to see the issue (that nut does not define a tag for P010 iiuc).

in reply to:  16 comment:17 by pheedbaq3, 21 months ago

Replying to cehoyos:

Replying to pheedbaq3:

Replying to cehoyos:

Replying to pheedbaq3:

Just saying, I'm not part of the dev group, don't have the entire build environment

That's indeed a problem as your change breaks fate and therefore cannot be committed as-is.

Not sure what you mean by "breaks fate"?

FFmpeg's self test is called fate, you run it with make fate which is sufficient to see the issue (that nut does not define a tag for P010 iiuc).

Ah ok, well that at least gives me a next direction to go in. I'll tinker with it a bit more and see if I can't resolve that.

in reply to:  16 comment:18 by pheedbaq3, 21 months ago

Replying to cehoyos:

FFmpeg's self test is called fate, you run it with make fate which is sufficient to see the issue (that nut does not define a tag for P010 iiuc).

So I ran the tests. First run, I got the same error that I believe you were referring to. Based on that I added the tag for P010 to nut.c. Second run, that error is now gone, but I get a different, nondescript (to my eyes anyway) error now:

ffmpeg version N-96535-g9793427c9e Copyright (c) 2000-2020 the FFmpeg developers
  built with Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28314 for x64
  configuration: --target-os=win64 --arch=x86_64 --toolchain=msvc
  libavutil      56. 38.100 / 56. 38.100
  libavcodec     58. 67.100 / 58. 67.100
  libavformat    58. 36.100 / 58. 36.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 71.100 /  7. 71.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
Input #0, image2, from 'c:/Users/User1/source/repos/ffmpeg/tests/vsynth1/%02d.pgm':
  Duration: 00:00:02.00, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: pgmyuv, yuv420p, 352x288, 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (pgmyuv (native) -> rawvideo (native))
Output #0, nut, to 'md5:':
    Stream #0:0: Video: rawvideo (P010 / 0x30313050), p010le, 352x288, q=2-31, 38016 kb/s, 25 fps, 51200 tbn, 25 tbc
    Metadata:
      encoder         : Lavc rawvideo
frame=    5 fps=0.0 q=-0.0 Lsize=    1485kB time=00:00:00.16 bitrate=76042.9kbits/s speed=12.3x    
video:1485kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.026831%

Not sure exactly what's going on there, but I'll keep at it.

Last edited 21 months ago by pheedbaq3 (previous) (diff)

comment:19 by pheedbaq3, 18 months ago

Would it be possible to have someone more knowledgeable (than myself) on the dshow and testing sections of code take a further look at this? I put some effort into trying to resolve the latest issue indicated by the test suite failure, but I haven't the foggiest idea where in the code (or test suite) the real issue is. The error I got did not really give me much of a direction to go in :(

Last edited 18 months ago by pheedbaq3 (previous) (diff)

comment:20 by Carl Eugen Hoyos, 18 months ago

I don't understand, what nondescript error do you see?

comment:21 by pheedbaq3, 18 months ago

See the post directly above my last. That is the output of fate at the point of failure.

Last edited 18 months ago by pheedbaq3 (previous) (diff)

comment:22 by Carl Eugen Hoyos, 18 months ago

There is no error visible.

comment:23 by Carl Eugen Hoyos, 18 months ago

Concerning your configure line: --arch=x86_64 has no effect

Last edited 18 months ago by Carl Eugen Hoyos (previous) (diff)

in reply to:  22 comment:24 by pheedbaq3, 18 months ago

My point exactly. It fails on that particular test and provides no further information.
Replying to cehoyos:

There is no error visible.

in reply to:  23 comment:25 by pheedbaq3, 18 months ago

Not sure what bearing that has on this, the tests run fine until fate gets to the one referenced in my previous post (tests on pgm files).
Replying to cehoyos:

Concerning your configure line: --arch=x86_64 has no effect

comment:26 by pheedbaq3, 16 months ago

Finally got back around to digging into this a bit more. Fate does indicate an error, but the error file itself doesn't seem to indicate anything in particular.

Fate indicating an error has occurred:

Test filter-pixdesc-p010le failed. Look at tests/data/fate/filter-pixdesc-p010le.err for details.
make: *** [tests/Makefile:256: fate-filter-pixdesc-p010le] Error 1

filter-pixdesc-p010le.err:

ffmpeg version 4.3.git Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10.1.0 (Rev3, Built by MSYS2 project)
  configuration: --samples=fate-suite/
  libavutil      56. 55.100 / 56. 55.100
  libavcodec     58. 93.104 / 58. 93.104
  libavformat    58. 47.100 / 58. 47.100
  libavdevice    58. 11.101 / 58. 11.101
  libavfilter     7. 86.100 /  7. 86.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
Input #0, image2, from 'C:/msys64/home/User1/ffmpeg/tests/vsynth1/%02d.pgm':
  Duration: 00:00:02.00, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: pgmyuv, yuv420p, 352x288, 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (pgmyuv (native) -> rawvideo (native))
Output #0, nut, to 'md5:':
    Stream #0:0: Video: rawvideo (P010 / 0x30313050), p010le, 352x288, q=2-31, 38016 kb/s, 25 fps, 51200 tbn, 25 tbc
    Metadata:
      encoder         : Lavc rawvideo
frame=    5 fps=0.0 q=-0.0 Lsize=    1485kB time=00:00:00.16 bitrate=76042.9kbits/s speed=16.2x    
video:1485kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.026831%
Last edited 16 months ago by pheedbaq3 (previous) (diff)

comment:27 by pheedbaq3, 7 months ago

bump

Any possible way to get someone to look at/test this 2-line patch to add support for P010 on the Live Gamer 4K (GC573)? The code for some reason breaks fate, but no clear error or diagnostic is given that indicates why.

Last edited 6 months ago by pheedbaq3 (previous) (diff)

in reply to:  27 comment:28 by Balling, 7 months ago

Replying to pheedbaq3:

bump

Any possible way to get someone to look at/test this 1-line patch to add support for P010 on the Live Gamer 4K (GC573)? The code for some reason breaks fate, but no clear error or diagnostic is given that indicates why.

What file is broken with FATE?? I found it very strange.

comment:29 by pheedbaq3, 6 months ago

Based on the error file FATE produced (filter-pixdesc-p010le.err):

Input #0, image2, from 'C:/msys64/home/User1/ffmpeg/tests/vsynth1/%02d.pgm'

Beyond that, I'm at the end of my diagnostic capabilities without further info, given my limited experience with the build environment and not being a member/contributor to the project. This is my very first experience attempting to dig into and modify code in ffmpeg. Just wanted to add support for the HDR format my capture card is capable of using :)

Last edited 6 months ago by pheedbaq3 (previous) (diff)

in reply to:  29 comment:30 by Balling, 6 months ago

Status: newopen

Replying to pheedbaq3:

Just wanted to add support for the HDR format my capture card is capable of using :)

Just for your information in many cases when you fix the code, etc, you will have to change FATE hashes. See https://github.com/FFmpeg/FFmpeg/commit/99882d05a6635446d587ed51b095c627abc42587

Now, why do you think it is now HDR? For it to be HDR you will have to tag AVI file as transfer characteristics PQ. P010 in by itself is not signalling HDR, of course.

Last edited 6 months ago by Balling (previous) (diff)

comment:31 by pheedbaq3, 6 months ago

Well, I'm basing that on the fact that my capture card software (AverMedia RECentral 4) has an HDR recording option that is only enabled if P010 format is also selected, so I assume it sets transfer characteristics to PQ with that option. Other formats in the program do not allow recording HDR at all, only P010.

I'm completely unfamiliar with FATE hashes, and how they are created/used. Do you have a concise explanation or perhaps documentation where I can read further on that?

Thanks for responding btw, I realize I'm kind of fumbling in the dark here :\

Last edited 6 months ago by pheedbaq3 (previous) (diff)

comment:32 by Balling, 6 months ago

Do we know how dshow signals PQ transfer function or any transfer function for that matter?

Last edited 6 months ago by Balling (previous) (diff)

comment:33 by Diederick Niehorster, 5 months ago

Cc: Diederick Niehorster added

comment:34 by Diederick Niehorster, 5 months ago

dshow currently doesn't get extended color information (as MS calls it, range, transfer matrix, etc) from the source device. But it is possible to query if the device exposes that info:
https://docs.microsoft.com/en-us/windows/win32/medfound/extended-color-information

Perhaps querying and using that information should be separate from this patch, which does what its supposed to do?

in reply to:  34 comment:35 by Balling, 5 months ago

Replying to Diederick Niehorster:

Perhaps querying and using that information should be separate from this patch, which does what its supposed to do?

Of course!!

P.S. At least PQ transfer MUST be signalled like this to say it is HDR. P010 or P016 (P016 is bad in ffmpeg though) do not signal HDR in by itself, they will default to BT.601 matrix (dunno about what transfer and primaries, but I suppose BT.709) in ffmpeg! Unless you will use not total raw, but something like y4m. See https://code.videolan.org/videolan/x264/-/commit/5bc04b8d1ed2f6c1a85e8734219eb38c2dccd2a4 and next commit.

Last edited 5 months ago by Balling (previous) (diff)

comment:36 by Diederick Niehorster, 5 months ago

@Balling, I'm new here. I have half a patch to at least extract the info from a dshow source (half because i am not color space expert, not sure i got mapping correct). I need help completing this. Can i submit WIP/help needed patches to this tracker as well, or is there a better forum for that?

in reply to:  36 comment:37 by Balling, 5 months ago

Replying to Diederick Niehorster:

@Balling, I'm new here. I have half a patch to at least extract the info from a dshow source (half because i am not color space expert, not sure i got mapping correct). I need help completing this. Can i submit WIP/help needed patches to this tracker as well, or is there a better forum for that?

No, they should be submitted to mailing list. I use this with Gmail: https://github.com/google/gmail-oauth2-tools/tree/master/go/sendgmail

The instruction is outdated though a little (you need to publish an app in google cloud platform). You must first subscribe (no need to listen to all patches, though, oogh). See: https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

not sure i got mapping correct

Paste the git diff here, I will tell you. It is pretty simple.

Last edited 5 months ago by Balling (previous) (diff)

comment:38 by Carl Eugen Hoyos, 5 months ago

Please do not mix the patch to fix this ticket with anything else, especially not with any colourspace signalling!

comment:39 by Carl Eugen Hoyos, 5 months ago

You can use git format-patch to create a patch file that you can attach to an email to the FFmpeg development mailing list, there is no need to use git send-email unless you want to use it.

in reply to:  38 comment:40 by Balling, 5 months ago

Replying to Carl Eugen Hoyos:

Please do not mix the patch to fix this ticket with anything else, especially not with any colourspace signalling!

It is needed for HDR. If it is indeed HDR. Sigh.

comment:41 by Diederick Niehorster, 5 months ago

Thanks Balling for advice on how to proceed, and the offer to look at what I've done! To stop further discussion here, i have made a ticket with a start of a patch: https://trac.ffmpeg.org/ticket/9271. This seemed better to me than the mailing list as its super incomplete (see mentioned TODOs). If even such not-meant-to-be-committed patches should go to mailing list, i'll close and go there.

in reply to:  39 comment:42 by Balling, 5 months ago

Replying to Carl Eugen Hoyos:

You can use git format-patch to create a patch file that you can attach to an email to the FFmpeg development mailing list, there is no need to use git send-email unless you wantu to use it.

You need to also set UTF-8 and use .txt for the file for it to be recognised as correct mime type. And even then it can fail on patchwork, because patchwork changes the 7-bit encoding of email while it resends stuff internally through your ffbox0-bg, etc, etc to get into gmail account for patchwork! (BTW, WHAT?)

Last edited 5 months ago by Balling (previous) (diff)

comment:43 by Balling, 5 months ago

Okay, I will send a patch in nut.c and raw.c and we will see how to fix FATE in tests/ref/fate/filter-pixdesc-p010le. I mean it was done before! https://patchwork.ffmpeg.org/project/ffmpeg/patch/20190514055313.22481-1-andreas.rheinhardt@gmail.com/
Wait a second, 0x30313050 is BE (big endian), no?

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