From bf206e870628f12fbeea6c7c8735968c7ff9b58b Mon Sep 17 00:00:00 2001 From: HITLAB Company Limited Date: Sat, 14 Feb 2026 00:14:06 +0700 Subject: [PATCH 1/2] Enhance pixel format handling in dshow.c Update dshow.c to handle additional pixel formats and codec tags. --- patches/ffmpeg.patch | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/patches/ffmpeg.patch b/patches/ffmpeg.patch index 1f3bb770..f6e92be2 100644 --- a/patches/ffmpeg.patch +++ b/patches/ffmpeg.patch @@ -20,3 +20,31 @@ index 732de59292..136347a0d2 100755 gmp libaribb24 liblensfun +diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c +index 6e97304850..582b2d05fe 100644 +--- a/libavdevice/dshow.c ++++ b/libavdevice/dshow.c +@@ -76,6 +76,14 @@ static enum AVPixelFormat dshow_pixfmt(DWORD biCompression, WORD biBitCount) + case 32: + return AV_PIX_FMT_0RGB32; + } ++ case 0xe436eb7b: ++ return AV_PIX_FMT_RGB565; ++ case 0xe436eb7c: ++ return AV_PIX_FMT_RGB555; ++ case 0xe436eb7d: ++ return AV_PIX_FMT_RGB24; ++ case 0xe436eb7e: ++ return AV_PIX_FMT_0RGB32; + } + return avpriv_pix_fmt_find(PIX_FMT_LIST_RAW, biCompression); // all others + } +@@ -1581,7 +1589,7 @@ dshow_add_device(AVFormatContext *avctx, + par->codec_type = AVMEDIA_TYPE_VIDEO; + par->width = fmt_info->width; + par->height = fmt_info->height; +- par->codec_tag = bih->biCompression; ++ par->codec_tag = fmt_info->pix_fmt == AV_PIX_FMT_NONE ? bih->biCompression : 0; + par->format = fmt_info->pix_fmt; + if (bih->biCompression == MKTAG('H', 'D', 'Y', 'C')) { + av_log(avctx, AV_LOG_DEBUG, "attempt to use full range for HDYC...\n"); From 9a2a2a08ec151a939e6d40479357ab069e2b245d Mon Sep 17 00:00:00 2001 From: Hao Truong Date: Wed, 18 Mar 2026 18:28:23 +0700 Subject: [PATCH 2/2] Swap color channel in dshow RGB --- patches/ffmpeg.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/ffmpeg.patch b/patches/ffmpeg.patch index 96ce7dea..9e1a0b5b 100644 --- a/patches/ffmpeg.patch +++ b/patches/ffmpeg.patch @@ -33,7 +33,7 @@ index 6e97304850..582b2d05fe 100644 + case 0xe436eb7c: + return AV_PIX_FMT_RGB555; + case 0xe436eb7d: -+ return AV_PIX_FMT_RGB24; ++ return AV_PIX_FMT_BGR24; + case 0xe436eb7e: + return AV_PIX_FMT_0RGB32; }