From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id B5ED44DF79 for ; Thu, 8 Jan 2026 20:42:30 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'WGqqbE6ESq8kPabPej74Pd49vYQfJexXVt7WV8WqWiI=', expected b'q8IC8HyumQf3ww8vSFce6DhqplGsQk1D63OaaQk+9/w=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1767904940; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=WGqqbE6ESq8kPabPej74Pd49vYQfJexXVt7WV8WqWiI=; b=vqHr1mfNhu/i7eqLx8PqD0ze77GF5NaFotlVgHuN0E4A/KVO2sKmFeXGm4jeom4qapXX6 pHBMlVDhHlZGv8nsBCMUZScmFI7HN35KoRNUo8SlR6e2I/6uP0dCIa2Hc+sGDnI9uP+fq+e WyWYcVtOEL3lPMF5SAAuPl6UkW20ulUPLirSRm+ERhJUkXddrdwuvabTyLLzwGR78coxeVL 42H2O3fqrE9XryMvxdHWOPwZq44IWwtVYZzIzQxU8X4s0B54wgRJ/9tXA/q5S/QMVLFnlKd EIYH92jKk2Ah6awN9GuvW/vWHG/Gl+dS5lUYthmqL21JrbmAYDrjenv8mEEg== Received: from [172.20.0.4] (unknown [172.20.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 717FC690D7A; Thu, 8 Jan 2026 22:42:20 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1767904923; b=ehZx4M+cv5hMokdaKkgcA7zpfnAd3GttBnX9XRE19RTMxGsuS2d7+RX0zLt1j/VrmdkXJ blt1DP+PODJee5aUyU8tmjYLfKTo1iCpHZ+8tWy4x3Fakq9aUesnFrHbJ8Pl/V2ySBfTzdT KIk2DiC0aVmIzQjq8fYmP/d2Y1X1HXB3BtFII9h2Qyi2LVVGUAMhAZAVvq1nzqfxPOC6ReF ttWw38RQNBQwEFU1jdPQK8lFWXpz8rmA07/zYUeMK3OqLXZdQ8bEwEHgszllR0ZcozOe5hj an+iVo97QfQrYZ7aeGz9mwdjhYpizvUlDEYJXHk4ZGP7RNiEwhytoHZJL44w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1767904923; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=/+fh4Zia4B47aqKhJgaARUJ6QXjpzBHabNtla4yogc0=; b=Wz+Pf41gj6aDLHQ9wAppoZ7U4wIZeC/TAuvd4jNXxon0vN39Flexp6TX3r4kq1GOgLgFQ kOZ6DzvRg6zVNhx+tCwJc61NlKH5Ah0MaLWpBmaue0AMATuJgxbpN5onUNekRQO3oSC4t/w +jfiDqVSWJDIOQ/Qw+CZH3q5P66ZSA0KDz+imHPZs+vip/0Xum04Ba09/Qf7veEbcypC19v 2eYO1aqIX+UzwTEx0RDlIaNsjecIcyrHkJ5/XtEjQu2FsomR2eH7vi5Nkn7cGHgWG/yesjI e3nQlhZpmIbreKeMgLOmUSMtqqKJZG7udssFKKbs/7+pg6wZJTK4zGpT57Og== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1767904914; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=q8IC8HyumQf3ww8vSFce6DhqplGsQk1D63OaaQk+9/w=; b=HxM76viRG/RxVyjHVeY69UKEvXZqbdPgLm/HB4DuDPPzo6iE+pEWwebyynmARK+W4qpLD NNdFxSUup+dJudakUcS6SZfGX2cBy8oPJAeEbbP8EoFSIvQQEo8tnMXjEttIHE+XqRwfrN3 LjHu2lZA3T8RHi31NuosKdfN8J7BUgOchM4ze1iyf5h5qlmu2K/NDL1SwGVzzlhTYrJTNgk 7VOxixk4v4gtfFDnehSDqs9vDH3dFSdU4xH/vUf/To7n+RS6fcpRtX3bWI9YQ1R7CkYDfM5 IKCxU56aqimsL213JRXQPgbtSx5P/gSBLdW3FyNdIVzfp28y++Ks3qHeeuBQ== Received: from f7c34508609e (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 767D8690D34 for ; Thu, 8 Jan 2026 22:41:54 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Thu, 08 Jan 2026 20:41:54 -0000 Message-ID: <176790491463.25.11408923085079381721@4457048688e7> Message-ID-Hash: CZGWHGZE3DAGD2HUPIDMZDBKZVIW4JOS X-Message-ID-Hash: CZGWHGZE3DAGD2HUPIDMZDBKZVIW4JOS X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PR] disabling background disposal for non alpha formats (PR #21414) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: hassanhany via ffmpeg-devel Cc: hassanhany Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21414 opened by hassanhany URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21414 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21414.patch this is in relation to Trac ticket 9602 which was reopened 2 weeks ago where the issue was there were gray bars in apng rgb24 (and other non alpha based formats) this PR fixes it by disabling the background disposal operation for non alpha formats since it relies on transparency as defined by the spec "APNG_DISPOSE_OP_BACKGROUND: the frame's region of the output buffer is to be cleared to fully transparent black before rendering the next frame." Building FFmpeg with this patch produces the correct output, removing the gray bars, >>From 253901b2b72889878d8bbe69c66c898fdfc011f4 Mon Sep 17 00:00:00 2001 From: "U-DESKTOP-70DF2U5\\GIGABYT" Date: Thu, 8 Jan 2026 21:04:52 +0200 Subject: [PATCH] disabling background disposal for non alpha formats --- libavcodec/pngenc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index e627bf83fc..808fac6a38 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -39,7 +39,7 @@ #include "libavutil/opt.h" #include "libavutil/rational.h" #include "libavutil/stereo3d.h" - +#include "libavutil/pixdesc.h" #include #define IOBUF_SIZE 4096 @@ -885,7 +885,8 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict, size_t best_bytestream_size = SIZE_MAX; APNGFctlChunk last_fctl_chunk = *best_last_fctl_chunk; APNGFctlChunk fctl_chunk = *best_fctl_chunk; - + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pict->format); + if (avctx->frame_num == 0) { best_fctl_chunk->width = pict->width; best_fctl_chunk->height = pict->height; @@ -919,7 +920,11 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict, // 0: APNG_DISPOSE_OP_NONE // 1: APNG_DISPOSE_OP_BACKGROUND // 2: APNG_DISPOSE_OP_PREVIOUS - + if(last_fctl_chunk.dispose_op==APNG_DISPOSE_OP_BACKGROUND) { + if(!(desc->flags & AV_PIX_FMT_FLAG_ALPHA)) { + continue; + } + } for (fctl_chunk.blend_op = 0; fctl_chunk.blend_op < 2; ++fctl_chunk.blend_op) { // 0: APNG_BLEND_OP_SOURCE // 1: APNG_BLEND_OP_OVER -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org