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 AE0DC4CE76 for ; Mon, 11 Aug 2025 12:04:27 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 3DC9C68C356; Mon, 11 Aug 2025 15:04:24 +0300 (EEST) Received: from out162-62-57-252.mail.qq.com (out162-62-57-252.mail.qq.com [162.62.57.252]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id F0F2268B0ED for ; Mon, 11 Aug 2025 15:04:16 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1754913853; bh=cQ9Nwa7+34WFePe7PCoF2E864nujWxRs+Iy5RupAc8M=; h=From:Subject:Date:References:To:In-Reply-To; b=lcemOk1hDdHpWsOlk3rhg9AUsqSyJcoa0qQiYDpjEYoTtIRdfh88PAWH9JBqE+z05 SxZo7EtvWWQuwZFgk3VD+u4cfPxsgBpvBCJebiALNjyhveVbsXfn/si+y8LJ5ngnQr siyWVMuOhwnKX1p1kjly3XbGoVBuk47mA1RFPkG8= Received: from smtpclient.apple ([119.147.10.242]) by newxmesmtplogicsvrsza56-0.qq.com (NewEsmtp) with SMTP id 10C196C3; Mon, 11 Aug 2025 20:04:12 +0800 X-QQ-mid: xmsmtpt1754913852t5wgne48i Message-ID: X-QQ-XMAILINFO: M+5cKLn0wXDtu/5w/rQKE1XUOx3H+ObLjGBHo0Sss5l8BuV5NT6kbLzLmxaWse CS2CDxkyjKfIdTuB8ZV2fOMrfgN+82VA+6zoR7QxcrzRpZvA1s90ptE0Oi6ysEpfDjFYfa+W3PTe jV+bgAfkulH+wixRq5M1G1bHBA+DPBfuNATWtfJ6JDHfjnQpdvEa9InWGXP74k7w8GUQOpyNtUoB zPt8Hyj958XPN8/48kJkQq6E8P6et7S6eq/jApyvwUSkbLP1inXx9KQPZ8iqyYYKzOC2fmbC5R0H XNPE3FMYNYMs6FCZLDB0Exu1sI4HDLiZbthCsjFQNqhPn0czGYiq5jE5EebvZR0AR+cPUwma2UdN NjaD41NQ0355u/Zazsujglm8e+eYFLFRCHvcjzDbkXGRjpBcPQnERVhXyityJPg8725IEpef4Ryk zlGDIB12q+qjw+sXJchakSj7Qx7YccdHn0ioeK02Kg/6zp3iT6IBaHI0Yeo0aGbq4uktwJiRX2u9 l58T5PoTccBboOn60/6zjq9qM8GyhnqHcUg3GrxcAeFzlQhmMEQKp5Gcx/9c7OwplzvHx7f3Nk9W CnFYvRydVwOUoUJSxdXgygc6ZkzOcK5kPX5n8h5Jn4J94Xk7yyo40p5UZcwkiI9IkVUL+YduHiVx rNfUtfYJC9tT+6unYmHXcmzLHsNK5+ItQ8UyePaG1hkbcQ10BrlYDkKC+3TiHMNO2TJdd2QzwEEW IjI37V5ekRqtCZU/xFMvUXncYOjIk3eYjS+xg3I7pxOtiljJubxJvCun1pMSFihlqBb32VDX2wJf OmPY/FWds6NlY5EbXEIUBRL3DL9FW8z0mKxOaowfjMcBt/kepHDZchbeziQfh6hNLgHBGOLmdKxn BFQrWVrltMaJr3AwyhMkaJj3Vf+D7/hoMDs5IFWtxOBjpCdUSwozCB+cWGhqwPfzm9n+zM/1Cy4j ovhd0UDjN+sb4umgiqYwzWAIT1yRdOc4HAfwIzd0zwaaYARH+ms33u6Cwh5oLgeZFw5wZQ+jFqbe EzQKW/wGMEE8XGUR5YIZW8Waqk7AwlCzB9aKUrxXtyEXoQhps4KYhezANOPbjRIY31rKzCTCIh47 s7dGUg X-QQ-XMRINFO: NS+P29fieYNw95Bth2bWPxk= From: Zhao Zhili Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Date: Mon, 11 Aug 2025 20:04:02 +0800 References: <20250811083755.CDB4D68BEE9@ffbox0-bg.ffmpeg.org> <20250811105138.GX29660@pb2> To: FFmpeg development discussions and patches In-Reply-To: <20250811105138.GX29660@pb2> X-OQ-MSGID: <081B21EA-AB41-477D-9BEE-D022CA206669@foxmail.com> X-Mailer: Apple Mail (2.3826.700.81) 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: 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: > On Aug 11, 2025, at 18:51, Michael Niedermayer wrote: > > 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 >> >> A set of files begins with the following byte sequence. >> >> 00000000 4c 41 4d 45 33 2e 31 30 30 aa aa aa aa aa aa aa |LAME3.100.......| >> 00000010 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa |................| >> * >> >> It seems they are encoded with lame, but missing header bytes at the >> beginning. >> >> Signed-off-by: Zhao Zhili >> >> >> 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 >> >> A set of files begins with the following byte sequence. >> >> 00000000 4c 41 4d 45 33 2e 31 30 30 aa aa aa aa aa aa aa |LAME3.100.......| >> 00000010 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa |................| >> * >> >> It seems they are encoded with lame, but missing header bytes at the >> beginning. >> >> Signed-off-by: Zhao Zhili >> --- >> libavformat/mp3dec.c | 7 +++++-- >> 1 file changed, 5 insertions(+), 2 deletions(-) >> >> 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>=7) return AVPROBE_SCORE_EXTENSION + 1; >> else if (max_frames>200 && p->buf_size < 2*max_framesizes)return AVPROBE_SCORE_EXTENSION; >> - else if (max_frames>=4 && p->buf_size < 2*max_framesizes) return AVPROBE_SCORE_EXTENSION / 2; >> - else if (ff_id3v2_match(buf0, ID3v2_DEFAULT_MAGIC) && 2*ff_id3v2_tag_len(buf0) >= p->buf_size) >> + else if (max_frames>=4 && 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_id3v2_tag_len(buf0) >= p->buf_size) > > why is this needed ? > > Naively i would expect that the probe code would detect a mp3 stream like 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 probe just report invalid data: 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 3ac558a6ebf467b42e4a42be3014c6c5.mp3: Invalid data found when processing input These files are only 1 to 2 seconds contains a single English word. I think the size of file is one of the reason of failed to detect. > > thx > > [...] > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > If the United States is serious about tackling the national security threats > related to an insecure 5G network, it needs to rethink the extent to which it > values corporate profits and government espionage over security.-Bruce Schneier > _______________________________________________ > 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". _______________________________________________ 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".