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 AFE094C303 for ; Mon, 11 Aug 2025 19:23:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id DB4A368C6B2; Mon, 11 Aug 2025 22:23:53 +0300 (EEST) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 3581768B92B for ; Mon, 11 Aug 2025 22:23:47 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 6E83E443F9 for ; Mon, 11 Aug 2025 19:23:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1754940226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3NJXsVXpxtE/SJ1XgM2GH4zePAnhyuY070zRoBtfXVQ=; b=aVd3HIMYddtvHRNWAzyON3yjQNofIMfE2gNxtiSAKAoqjW/3AEeFm2E6XORwZbujWBZGyB foppZbvOnxRn/LpNWqSo6WZmiWkxnW0ubXJ8aBgEHFWGP+Zts+6VprYasoNfMMuy9Xwh2g 8Qe8+jJK/A6enkMXJK/z7F/SZZSxZuUzfd9ycoq5FhMr9CU3Y9kKMhzvZYUGv9peq7KbsI MlD2z2+XEkmZpX8SlXPbWb+hAQRsjtLQyBsZval97d6DQPSE5F2X/Gg7pRGnsvVL79V8vI KiXQgE87Den97x5661sQ6rxd5YLTTQ4Mg1NGMMcQcGgwjAM1kratJA2tKyVflw== Date: Mon, 11 Aug 2025 21:23:44 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250811192344.GA29660@pb2> References: <20250811083755.CDB4D68BEE9@ffbox0-bg.ffmpeg.org> <20250811105138.GX29660@pb2> MIME-Version: 1.0 In-Reply-To: X-GND-State: clean X-GND-Score: -90 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddufeefvdekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculddutddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeffledtfeevfeffheeuuefhtdejieelueeftdeitdfgheetgefffeefteekffdthfenucffohhmrghinhepfhhfmhhpvghgrdhorhhgnecukfhppeeguddrieeirdeihedrudejieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeihedrudejiedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] avformat/mp3dec: Workaround mp3 detection failure (PR #20212) 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: multipart/mixed; boundary="===============0334284671559874693==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============0334284671559874693== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="1ski572q94CkAsDn" Content-Disposition: inline --1ski572q94CkAsDn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 11, 2025 at 08:04:02PM +0800, Zhao Zhili wrote: >=20 >=20 > > On Aug 11, 2025, at 18:51, Michael Niedermayer = wrote: > >=20 > > On Mon, Aug 11, 2025 at 11:37:55AM +0300, quink wrote: > >> PR #20212 opened by quink > >> URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20212 > >> Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20212.patch > >>=20 > >> A set of files begins with the following byte sequence. > >>=20 > >> 00000000 4c 41 4d 45 33 2e 31 30 30 aa aa aa aa aa aa aa |LAME3.100= =2E......| > >> 00000010 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa |.........= =2E......| > >> * > >>=20 > >> It seems they are encoded with lame, but missing header bytes at the > >> beginning. > >>=20 > >> Signed-off-by: Zhao Zhili > >>=20 > >>=20 > >> From e24f7b8d0fbc4295b3dfc9832d7b552086f45ff0 Mon Sep 17 00:00:00 2001 > >> From: Zhao Zhili > >> Date: Mon, 11 Aug 2025 15:23:36 +0800 > >> Subject: [PATCH] avformat/mp3dec: Workaround mp3 detection failure > >>=20 > >> A set of files begins with the following byte sequence. > >>=20 > >> 00000000 4c 41 4d 45 33 2e 31 30 30 aa aa aa aa aa aa aa |LAME3.100= =2E......| > >> 00000010 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa |.........= =2E......| > >> * > >>=20 > >> It seems they are encoded with lame, but missing header bytes at the > >> beginning. > >>=20 > >> Signed-off-by: Zhao Zhili > >> --- > >> libavformat/mp3dec.c | 7 +++++-- > >> 1 file changed, 5 insertions(+), 2 deletions(-) > >>=20 > >> diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c > >> index 31eeb68ebb..fd692a9c76 100644 > >> --- a/libavformat/mp3dec.c > >> +++ b/libavformat/mp3dec.c > >> @@ -121,8 +121,11 @@ static int mp3_read_probe(const AVProbeData *p) > >> // issues with MPEG-files! > >> if (first_frames>=3D7) return AVPROBE_SCORE_EXTENSION + 1; > >> else if (max_frames>200 && p->buf_size < 2*max_framesizes)return A= VPROBE_SCORE_EXTENSION; > >> - else if (max_frames>=3D4 && p->buf_size < 2*max_framesizes) retur= n AVPROBE_SCORE_EXTENSION / 2; > >> - else if (ff_id3v2_match(buf0, ID3v2_DEFAULT_MAGIC) && 2*ff_id3v2_= tag_len(buf0) >=3D p->buf_size) > >> + else if (max_frames>=3D4 && p->buf_size < 2*max_framesizes) { > >> + if (!memcmp(p->buf, "LAME3.100", sizeof("LAME3.100") - 1)) > >> + return AVPROBE_SCORE_EXTENSION - 2; > >> + return AVPROBE_SCORE_EXTENSION / 2; > >> + } else if (ff_id3v2_match(buf0, ID3v2_DEFAULT_MAGIC) && 2*ff_id3v= 2_tag_len(buf0) >=3D p->buf_size) > >=20 > > why is this needed ? > >=20 > > Naively i would expect that the probe code would detect a mp3 stream li= ke this > > based on max_frames > > why does that fail ? > > as what is teh stream detected instead ? > > maybe whatever detects it, is wrong instead and can be improved by not = missdetecting it >=20 > probe just report invalid data: >=20 > Probing mp3 score:25 size:2048 > Probing h263 score:25 size:4096 > Probing mp3 score:25 size:4096 > Probing h263 score:25 size:8192 > Probing mp3 score:25 size:8192 > Probing h263 score:25 size:16384 > Probing mp3 score:25 size:16384 > Probing h263 score:25 size:20160 > Probing mp3 score:25 size:20160 > Probing h263 score:25 size:20160 > Probing mp3 score:25 size:20160 > [AVIOContext @ 0x127f04ac0] Statistics: 20160 bytes read, 0 seeks >=20 > 3ac558a6ebf467b42e4a42be3014c6c5.mp3: Invalid data found when processing = input >=20 > These files are only 1 to 2 seconds contains a single English word. I thi= nk the size of file > is one of the reason of failed to detect. they are valid h263 ? if not, can teh h263 probe test be improved so they are not detected as h26= 3? thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB He who knows, does not speak. He who speaks, does not know. -- Lao Tsu --1ski572q94CkAsDn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaJpDPAAKCRBhHseHBAsP q84FAJ9qgh8tNowMQAaxUFLqDdZe4wCckgCdFuWHvIiYBRphO7TtqocskVDlUsU= =7te4 -----END PGP SIGNATURE----- --1ski572q94CkAsDn-- --===============0334284671559874693== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============0334284671559874693==--