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 D7F25453FA for ; Tue, 26 Dec 2023 22:25:27 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E726268CBD5; Wed, 27 Dec 2023 00:25:24 +0200 (EET) Received: from ssq0.pkh.me (laubervilliers-656-1-228-164.w92-154.abo.wanadoo.fr [92.154.28.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9DBFF68C671 for ; Wed, 27 Dec 2023 00:25:18 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pkh.me; s=selector1; t=1703629518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=uHRou7IaLkn9DVcqgrl5TkGO5VekyLH/LeNgnFnJKCw=; b=YRg25UimsdiFWy/bzjNuRoZjSxNx9FZVRhDtalavQDqYgzpyfKhcsjBmXdeC3VNfVoJdQ+ 73GRWMOb6SxBlh8+Az3XQGcVUJIffFYVJaG2g6fNHObtZMiaASVaGxEsf90HPGoDyfOTHz rxosWU0JV5/B8J1aPxGAK29k6F46q6w= Received: from localhost (ssq0.pkh.me [local]) by ssq0.pkh.me (OpenSMTPD) with ESMTPA id a1cb63ef; Tue, 26 Dec 2023 22:25:17 +0000 (UTC) From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= To: ffmpeg-devel@ffmpeg.org Date: Tue, 26 Dec 2023 23:25:15 +0100 Message-ID: <20231226222516.2513700-1-u@pkh.me> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/proresenc: make transparency honored in mov/QT 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 Cc: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= 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: In the mov muxer (in mov_write_video_tag()), bits_per_coded_sample will be written under certain conditions and is required to be 32 for the transparency to be honored in QuickTime. prores_kostya already has this setting but prores_anatoliy and prores_videotoolbox didn't. --- libavcodec/proresenc_anatoliy.c | 3 +++ libavcodec/videotoolboxenc.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index a1cb46aa59..16741afd68 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -930,6 +930,9 @@ static av_cold int prores_encode_init(AVCodecContext *avctx) } } + if (ctx->need_alpha) + avctx->bits_per_coded_sample = 32; + ff_fdctdsp_init(&ctx->fdsp, avctx); avctx->codec_tag = AV_RL32((const uint8_t*)profiles[avctx->profile].name); diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index 15e0e1fe29..644fd60b00 100644 --- a/libavcodec/videotoolboxenc.c +++ b/libavcodec/videotoolboxenc.c @@ -521,6 +521,8 @@ static CMVideoCodecType get_cm_codec_type(AVCodecContext *avctx, } return kCMVideoCodecType_HEVC; case AV_CODEC_ID_PRORES: + if (desc && (desc->flags & AV_PIX_FMT_FLAG_ALPHA)) + avctx->bits_per_coded_sample = 32; switch (profile) { case AV_PROFILE_PRORES_PROXY: return MKBETAG('a','p','c','o'); // kCMVideoCodecType_AppleProRes422Proxy -- 2.43.0 _______________________________________________ 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".