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 58EBD43D68 for ; Fri, 9 Dec 2022 12:09:53 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F184C68BC35; Fri, 9 Dec 2022 14:09:50 +0200 (EET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2039.outbound.protection.outlook.com [40.92.91.39]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2C90F68B4E4 for ; Fri, 9 Dec 2022 14:09:44 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ewqW+dy+3AM00QAx2I6JoMNhVW3WhN+f/XwDcfskfoeAf4MioGyJoetHklt5UjOzG3ucG50zlkM/buSlqPQbi5kr7LXW3Te6+/Daamjz4EN7xfTk/ClchTFrQQxLRCIruGslmAVlXnlGjC8Y1+UGBxcnw/evKzDM2647j25vpgEbwPxdHhmBIgngOy/i8rRtLz/fclGKpgiJWeZVYN9jvh7eg8d6zrINepF7rhlpvh7eLRbnEB5tOCY7TjNmp0OR3kHbrWR9cO+s/M+S5oWmloupZyUhStDl2hD2JtSlZvoUFnHPOwL6jQJEQFWxOv19RGMAbRK0xWw74uGUR5Xx3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7e2WsMAjk7WHZ72cMNDmJaTmyMueijtcS63UkgJBMAg=; b=eZsMOrC9WGjFxra0m/4CaQ5K1Ng+u3ix9L2+0F5O4h0mJ4Py4HS8BRgfeC/POqqDGujX8MdsjNvh+wgjv+VHZbJ/X3q1x35K7tDyDseXJdBPFeXYatIAJR4QhNp7SsxqtvJ1NdyeAhS4BHCuW2S36iOnjlqf6i3t07f4lJCOmE4gXaXTLPF6pnxEbv2H76W6oa5DtEX1UWTtaVJtWbTtsUlpDNtv14fHolEXeYaMPEmFbz/CRap+AXUeoCT9qzGgM8PdE53eLR7M1YwC5HO1/WRUnjHFX5l2pBmVNB97YMD1nuKbyJc0YIwofZqCrkbZQwtWVsqPvVZPs+4ZJZ/cVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7e2WsMAjk7WHZ72cMNDmJaTmyMueijtcS63UkgJBMAg=; b=ich6IM+wWSeAbLZkRJGSAi4uMSByGcxjrX3tCi6xHZ4pbimk/gnTKJsrcubnhb45AvIiVUZd32QL0uOumYHEX2gzruHsWAHrZvhK6iWoRLU4Yi3Ex5lxbv1rLRRuMFJRpTrzQ1J1BiLLdJze/hx6FL7PPfFf26bN4NVlaI4HO0jYHCxmhkeiJx0xg36aDnLxexTFw6zu9nUExJBQWI4h6MrxFLwh7rl86CGsff4R2FONqUktYza0ysDeZWZppB4iCuZ+6MqV2CT/k3HFwyYnPFXiOW/sCpHt8IUlCA49Bnx2cc4xjS2KxX99hSXANF96fYyUxb89eFliiDDkYE76lw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS8P250MB0394.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:358::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.11; Fri, 9 Dec 2022 12:09:42 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::da14:61e3:630a:70b5]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::da14:61e3:630a:70b5%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 12:09:42 +0000 Message-ID: Date: Fri, 9 Dec 2022 13:10:02 +0100 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20221209124941.GB66771@haasn.xyz> From: Andreas Rheinhardt In-Reply-To: <20221209124941.GB66771@haasn.xyz> X-TMN: [Gyh6L9bi2cxJzjqK6cyouHXmioY0fLtp] X-ClientProxiedBy: ZR2P278CA0041.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:47::10) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <4e8a95b5-da24-5349-fd7b-950f20672e2f@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS8P250MB0394:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a8267eb-7374-48a5-92eb-08dad9de40d2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OtuTurw5Q3kLDv0GKJL23/5KA7fq7+XUkPi2xosK28GbbOz7Xbnw0PFwN+qvI3tjS7yxWNnqr7kI78myqbNs4O8/OSY/pWK1ZxmOm81ZNgGqIQYdKE4v7mNcv2F4Xp4H0yN7y4bczAQ0Fp8ppbE5OXap/ruiRognQsRmK3pFYSLhuz9ERzW4V5T+syYLLBgetQrxHUniVr/+BPXZMy/mlBGzlkcXBUpNYcrQag7UzCTxy9pIVUdk8tU6bEVBojw4rkJqHrGsrpxh7rVxifPDMhHVunV6/IAh+NdzbO97QD0x+r2UDknLJQsHe+OGZpkiKH2hSMoLmSMU4avYpdoLzhIRZ3ZMv6QTs+wIWum7R5SLdQdrRSdXk4gKeGdsOdOmPiDqaqUP//OHrW9OYBjZnMos4Amumr/a4d3R56/GsjnVx4ktwHpSFS5N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4Z3dzaGV4eEZraUduYTA1dUdqMUVidU10?= =?utf-8?B?Wk5SMER3clVTMWdpMVg0ZExCODZMazRZdm1CSlplQWhvR1g0bWtlRXpDR0h1?= =?utf-8?B?QWEwbjFWdkxHQmVmdCtaOUU1YVVFdnJ6OHBFdkMrSWd0RFh3b1lPanJvYUNn?= =?utf-8?B?bnJUUTZmN1hIU3Y2ZEQyd0ljRnRacEVGTnFJaDFsdSsvWlZMQ21jSWxLcG80?= =?utf-8?Q?NKXrQdp6eIdBIcMFvE=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a8267eb-7374-48a5-92eb-08dad9de40d2 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 12:09:42.2834 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8P250MB0394 Subject: Re: [FFmpeg-devel] Towards YUVJ removal 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Niklas Haas: > So, as was discussed at the last meeting, we should move towards > removing YUVJ. I want to gather feedback on what appears to be to the > major hurdle, and possible ways to solve it. > > The basic major issue is how to handle the case of combining limited > range input with an encoder for a format that only accepts full range > data. The common case, for example, would be converting a frame from a > typical video file to a JPEG: > > $ ffmpeg -f lavfi -i smptebars -vframes 1 output.jpg > > Currently, this works because the JPEG encoder only advertises YUVJ > pixel formats, and therefore ffmpeg auto-inserts swscaler to convert > from limited range to full range. But this depends on conflating color > range and pixel formats, which is exactly what has been marked > deprecated for an eternity. > This is incorrect: Here are the pixel formats advertised by the mjpeg encoder: .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, ffmpeg only inserts the swscale filters, because said list is overridden in get_compliance_normal_pix_fmts() in fftools/ffmpeg_filter.c. See 059fc2d9da5364627613fb3e6424079e14dbdfd3. Also notice that the encoder errors out if fed with limited range data depending upon strict_std_compliance (see ff_mjpeg_encode_check_pix_fmt()), which is very similar to the first approach below; the override being in fftools implies that the breakage of the first approach would be confined to users of fftools. > Now, there are some solutions I can see for how to handle this case in > a non-YUVJ world: > > 1. Simply output an error, and rely on the user to insert a conversion > filter, e.g.: > > $ ffmpeg -f lavfi -i smptebars -vframes 1 output.jpg > error: inputs to jpeg encoder must be full range > > $ ffmpeg -f lavfi -i smptebars -vframes 1 -vf scale=out_range=jpeg output.jpg > ... works > > 2. Have the JPEG encoder take care of range conversion internally, by > using sws to convert limited to full range. > > 3. Allow filters to start exposing color space metadata as part of > filter negotiation, and then auto-insert swscaler whenever colorspace > conversion needs to happen as a result of filters not accepting the > corresponding color metadata. This would also allow more than just > conversion between limited/full range. > > 4. Combine approach 1 with an encoder flag for "supports full range > only", and have ffmpeg.c auto-insert a scale filter as the last step > before the encoder if this flag is set (and input is limited range). > > 1 would be the most explicit but would break any existing pipeline that > includes conversion to jpeg, which is probably a very large number. > > 2 would be the least work, but violates abstraction boundaries. > > 3 would be the most work and is, IMO, of questionable gain. > > 4 would be both explicit and not break existing workflows. > > Thoughts? _______________________________________________ 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".