From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 08ED748FD4 for ; Tue, 30 Jan 2024 22:36:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 74AB168CDBC; Wed, 31 Jan 2024 00:36:45 +0200 (EET) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8C8B868C69B for ; Wed, 31 Jan 2024 00:36:38 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id DE60040002 for ; Tue, 30 Jan 2024 22:36:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1706654198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UgyGqIrOfLX/ecYGYD3fJnLaQleYrzkbNZ0Bp8lg44Q=; b=Tr6Abf+75KEEzcD0v9yjpst339myPEZJBlNeFa6F3oFz/DhOrWqIGaNB9FM3BCZpBi3t8T uBi5X+1ztAvteqPfirLSMhB11ZvjtQiAI20wYQXzmSZa8K5P7OhQVUGcRM/HA5STiheC9S vFfc/y+dptJ8k7jDVKp6uRDip7FBYpuAP45NFZGUtnmJvScjwruwiAv9G/Ai+y5z2aiVuU KGdFba7R0I5L3yMNGFkU8rbovaY/AZOO2X6pXNjFWoz6sMnnFIpw9E/1OTgOIUZocL0eoc ABMsKhtTMPgVEbGT1Ve/CUgl3yo6GgpmvZ9JM7PryCxOwW8e02KhWHsAcLyLmA== Date: Tue, 30 Jan 2024 23:36:37 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240130223637.GN6420@pb2> References: <20231231214948.CD436411659@natalya.videolan.org> <20240129031943.GR1833374@pb2> <20240129194949.GB11235@haasn.xyz> MIME-Version: 1.0 In-Reply-To: <20240129194949.GB11235@haasn.xyz> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [FFmpeg-cvslog] vf_scale: use colorspace negotiation API X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============4875691833289301233==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4875691833289301233== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gqjSRfxl56Vkpwsg" Content-Disposition: inline --gqjSRfxl56Vkpwsg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 29, 2024 at 07:49:49PM +0100, Niklas Haas wrote: > On Mon, 29 Jan 2024 04:19:43 +0100 Michael Niedermayer wrote: > > On Sun, Dec 31, 2023 at 09:49:47PM +0000, Niklas Haas wrote: > > > ffmpeg | branch: master | Niklas Haas | Tue Oct 31 13= :52:53 2023 +0100| [45e09a30419cc2a7251e72689142e021ecdfe6d9] | committer: = Niklas Haas > > >=20 > > > vf_scale: use colorspace negotiation API > > >=20 > > > This filter will always accept any input format, even if the user sets > > > a specific in_range/in_color_matrix. This is to preserve status quo w= ith > > > current behavior, where passing a specific in_color_matrix merely > > > overrides the incoming frames' attributes. (Use `vf_format` to force > > > a specific input range) > > >=20 > > > Because changing colorspace and color_range now requires reconfiguring > > > the link, we can lift sws_setColorspaceDetails out of scale_frame and > > > into config_props. (This will also get re-called if the input frame > > > properties change) > > >=20 > > > > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=3Dcommit;h=3D45e09= a30419cc2a7251e72689142e021ecdfe6d9 > > > --- > > >=20 > > > libavfilter/vf_scale.c | 188 +++++++++++++++++++++++++++------------= ---------- > > > 1 file changed, 103 insertions(+), 85 deletions(-) > >=20 > > This seems to remove metadata > >=20 > > ./ffmpeg -f lavfi -i color=3Dblack -pix_fmt yuv422p10le -bitexact -vfra= mes 1 -f framecrc - > >=20 > > Stream #0:0: Video: rawvideo (Y3[10][10] / 0xA0A3359), yuv422p10le(tv,= progressive), 320x240 [SAR 1:1 DAR 4:3], q=3D2-31, 38400 kb/s, 25 fps, 25 = tbn > > vs > > Stream #0:0: Video: rawvideo (Y3[10][10] / 0xA0A3359), yuv422p10le(pro= gressive), 320x240 [SAR 1:1 DAR 4:3], q=3D2-31, 38400 kb/s, 25 fps, 25 tbn > >=20 > >=20 > > when its stored in a file, it results in a different output, example: > > ./ffmpeg -f lavfi -i color=3Dblack -pix_fmt yuv422p10le -bitexact -vfra= mes 1 -c:v ffv1 -level 3 -y ffv1-lavf-black-4636-new.mkv > >=20 > >=20 > > I have not investigated what is correct, but i would think "no range in= formation" > > would seem worse than whatever the correct is >=20 > Looking at this quickly, what is happening here is not that vf_scale is > stripping metadata, it's that vf_scale used to *add* default metadata aft= er > a pixel format conversion - even though it did not touch the pixel > range, and the incoming frames were untagged. This was arguably a bug. > The new behavior is actually less surprising here - the vsrc generates > untagged frames, so vf_scale preserves them being untagged. >=20 > (Observe -vf showinfo,format=3Dyuv422p10le,showinfo before vs after patch) >=20 > In any case, the *proper* fix here would be to make vsrc_testsrc aware > of the colorspace negotiation API. Ideally, it should switch from > ff_draw_init to ff_draw_init2, and use the negotiated YUV colorspace and > range. (pal(75|100)bars are also bugged) Thanks alot for analyzing, ive added a note locally so if i run into another case ill remember I dont have time ATM to fix vsrc_testsrc thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No snowflake in an avalanche ever feels responsible. -- Voltaire --gqjSRfxl56Vkpwsg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZbl58QAKCRBhHseHBAsP q5GOAJ9/WIqGgYmSL9coGBkHIpzB/5uJPACdETDNCTUvBrCB4YAX9+HnG9LuTVw= =DNsX -----END PGP SIGNATURE----- --gqjSRfxl56Vkpwsg-- --===============4875691833289301233== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --===============4875691833289301233==--