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 CD03C403A8 for ; Sun, 23 Jan 2022 13:16:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9013E68AF87; Sun, 23 Jan 2022 15:16:10 +0200 (EET) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 01F9668AF10 for ; Sun, 23 Jan 2022 15:16:03 +0200 (EET) Received: by mail-wr1-f47.google.com with SMTP id h29so6037748wrb.5 for ; Sun, 23 Jan 2022 05:16:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=y29fhps4bL6oy1oL8F+FCzbkEZEarnCLoHLUIQaYFjY=; b=MAgja8Ir2uyx1QLUy2AyYpNU/mM4ceGykZ97Eu/4D3uLFr466p7coOZjyo4ZKsaoHn OVqIjDMzTYKA5pFbZVNzFRbcU2tMn36LkBEFxVrCX2rWPW/Rnz3FbnG5pabQFK1Z5onr k3zRVA4+O/H1rcI1oUfX1Ep65NIBO3GbbYWBJyeFfQZu2VmFemu7Y0EuEJJcKeZzbMPa L6gY9RaFVr7+5FMxJaMm79EykNsQsQgufPQ4YiWIj/dRdptmJa0JyjNYtpoHOza8o9yx ZWmm7ATWLyMzAjFf1bwyLWG242XBbyu60pH5TvnkQbtXauDuJDwU37YOutyrJPYzR8WB mC+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=y29fhps4bL6oy1oL8F+FCzbkEZEarnCLoHLUIQaYFjY=; b=4fuwMwqZYc2xf0rR2jgVvCwjhkG7Pgge4Nf2DP5+n0BvAU4NUbcuNQRT5A9Hk+EU1X QRzrjiIA0L/w75JHkWsxv/XDQ09xF/nE9P10PA4l9+cdMTMn0V9YzAMCQLZPIqEvES2E qtChXH/JC2dZjuDEowBY92g5Gh6D6kKZRCCHeHf5BzMsDH83+6uuD3/DB8yGgkgzcRn3 VQPQGDay768tmlawsNn5qoSorKi4neahD+9ympeT7ZCDl1NNExmrictIsSkpGoQ1n33N c8K036aTX4OQk8DY3y5hCY7rDL8Q/xtqeqI6ryZIRg+6CqgwFtC5qwSng7O8wW2IMwCI 3QMA== X-Gm-Message-State: AOAM531vbcHuwjqQKUMhBc1woI1TLE97y4/rnwntugXC6bmWtLhlEknT 1i6PgjvfaUdyMiVoLz+PbGwS1dPs7lFLT6ve27HEpIr6 X-Google-Smtp-Source: ABdhPJwHFKuc3OVza3VdOVZUP6kPPF2PA0DS7e9dA+R/xHU9aREH/2GXysQEmk3ztgVdVBTZHezr/rNBBX8plBhNYY4= X-Received: by 2002:a5d:58fc:: with SMTP id f28mr10643277wrd.665.1642943763167; Sun, 23 Jan 2022 05:16:03 -0800 (PST) MIME-Version: 1.0 References: <20220120160506.32698-1-anton@khirnov.net> <20220120160506.32698-3-anton@khirnov.net> <164271348312.23111.1441973187508043407@lain.red.khirnov.net> In-Reply-To: <164271348312.23111.1441973187508043407@lain.red.khirnov.net> From: Martijn van Beurden Date: Sun, 23 Jan 2022 14:15:53 +0100 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Op do 20 jan. 2022 22:18 schreef Anton Khirnov : > 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. > I think this patch shouldn't be applied. Without it 32 bit audio is transcoded to 24 bit audio, which is not lossless. However, with this patch 24 bit audio is transcoded to 32 bit audio which is lossless, but the resulting files are understood by few software decoder and probably no hardware decoders. Perhaps adding a warning instead of setting a default would be better? > _______________________________________________ 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".