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 44AF24026A for ; Thu, 20 Jan 2022 21:18:11 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BD25B68B20E; Thu, 20 Jan 2022 23:18:09 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5491D68B175 for ; Thu, 20 Jan 2022 23:18:04 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id D531324017C for ; Thu, 20 Jan 2022 22:18:03 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id oNyxj1BmmPtC for ; Thu, 20 Jan 2022 22:18:03 +0100 (CET) Received: from lain.red.khirnov.net (lain.red.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.red.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 5F828240179 for ; Thu, 20 Jan 2022 22:18:03 +0100 (CET) Received: by lain.red.khirnov.net (Postfix, from userid 1000) id 3545216008E; Thu, 20 Jan 2022 22:18:03 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: References: <20220120160506.32698-1-anton@khirnov.net> <20220120160506.32698-3-anton@khirnov.net> Mail-Followup-To: FFmpeg development discussions and patches Date: Thu, 20 Jan 2022 22:18:03 +0100 Message-ID: <164271348312.23111.1441973187508043407@lain.red.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 3/3] lavc/encode: pick a sane default for bits_per_raw_sample if it's not set 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: Quoting Martijn van Beurden (2022-01-20 19:58:54) > Op do 20 jan. 2022 om 17:05 schreef Anton Khirnov : > > > Fixes #9563. > > --- > > libavcodec/encode.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/libavcodec/encode.c b/libavcodec/encode.c > > index b6f81d1458..44ab81af3f 100644 > > --- a/libavcodec/encode.c > > +++ b/libavcodec/encode.c > > @@ -535,6 +535,9 @@ static int encode_preinit_audio(AVCodecContext *avctx) > > return AVERROR(EINVAL); > > } > > > > + if (!avctx->bits_per_raw_sample) > > + avctx->bits_per_raw_sample = 8 * > > av_get_bytes_per_sample(avctx->sample_fmt); > > + > > return 0; > > } > > > > This creates a new regression: now 24-bit WAV files are converted to 32-bit > WavPack files. I think I found the cause of the problem though: the issue > is that wavpack uses sample format s32p and 24-bit wav files use s32. > Therefore, a aresample filter is auto-inserted to convert s32p to s32, > which causes ost->filter->graph->is_meta to be false. You can work around this by using the -bits_per_raw_sample option. Handling this in a more automagic manner would be complicated - we could propagate bits_per_raw_sample through lavfi or add it to AVFrame. -- Anton Khirnov _______________________________________________ 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".