PR #25972 opened by Forgejo_Fairy
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25972
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25972.patch

Automatic PNG extraction from the DXV HQ sample in #23017 fails because the 
scale filter does not accept its YCgCo colorspace. Document an explicit zscale 
conversion for full-range, 8-bit YCgCo input, and explain why planar RGB output 
must be requested before conversion to a PNG-compatible pixel format.

Validated the documented command with the attached sample on master ef533ef3a3e 
using libzimg 3.0.5. The result closely matches the reporter's manual 
reconstruction. The filter manual builds successfully with makeinfo, and all 
six existing DXV FATE tests pass.

This documents a working conversion path; it does not fix automatic swscale 
conversion or close #23017.


>From b6443a9fb1a28599b1d1be896e5ea5cae6197e44 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <[email protected]>
Date: Sun, 6 Sep 2026 22:21:43 +0000
Subject: [PATCH] doc/filters: document YCgCo to RGB conversion with zscale

Add a full-range, 8-bit YCgCo to PNG example and explain why planar RGB output 
is requested from zscale. This provides an explicit conversion path for inputs 
such as the DXV HQ sample in issue #23017.

Assisted-by: Fairy
---
 doc/filters.texi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/doc/filters.texi b/doc/filters.texi
index b7379d3060a..10605c7ffe5 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -27381,6 +27381,17 @@ horizontal and vertical output chroma subsample 
values. For example for the
 pixel format "yuv422p" @var{hsub} is 2 and @var{vsub} is 1.
 @end table
 
+@subsection Examples
+
+Convert a full-range, 8-bit YCgCo input to RGB and extract its first frame as
+a PNG:
+@example
+ffmpeg -i input.mov -vf 
"zscale=matrixin=ycgco:rangein=full:matrix=gbr:range=full,format=gbrp" 
-frames:v 1 output.png
+@end example
+The planar RGB format @code{gbrp} makes @ref{zscale} perform the color
+conversion before the automatic conversion to a pixel format supported by
+the PNG encoder. Set @option{rangein} to match the input's actual range.
+
 @subsection Commands
 
 This filter supports the following commands:
-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to