Skip Menu |

This queue is for tickets about the Image-ExifTool CPAN distribution.

Report information
The Basics
Id: 42364
Status: resolved
Worked: 20 min
Priority: 0/
Queue: Image-ExifTool

People
Owner: EXIFTOOL [...] cpan.org
Requestors: koolkanishka [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 7.60
Fixed in: 7.67



Subject: "Error: File format error" for an MP3 file (works in Winamp)
Hello, I came across an error reported by ExifTool while trying to access the Metadata attributes of an MP3 file (attached). I tried the following command: exiftool mouse.mp3 This is the error I obtained: Error: File format error - mouse.mp3 Winamp was able to successfully open the same file and display the Metadata attributes. Thank you, Kanishka Banerjee
Subject: mouse.mp3
Download mouse.mp3
audio/mpeg 335.9k

Message body not shown because it is not plain text.

Sorry for the delay, somehow I missed the mail on this report, so the 7.62 update that went out won't contain this fix. Thanks for the bug report and sample file. The problem is that the audio frame sync is further into the file than exiftool scans. (ExifTool scans the first 256 bytes, but there are 400 bytes of zeros before the start of the audio data in your file). I will update the next release of exiftool (7.63) to scan the first 512 bytes, which will solve the problem for this file. - Phil
Subject: Re: [rt.cpan.org #42364] "Error: File format error" for an MP3 file (works in Winamp)
Date: Tue, 20 Jan 2009 15:05:08 +0800
To: bug-Image-ExifTool [...] rt.cpan.org
From: Kanishka Banerjee <koolkanishka [...] gmail.com>
Hi Phil, Thanks for the analysis. I have a query: Isn't MP3 a standard which mentions the details regarding audio frame sync, where it should be, etc.? Regards, Kanishka Banerjee On Fri, Jan 16, 2009 at 10:57 PM, Phil Harvey via RT < bug-Image-ExifTool@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=42364 > > > Sorry for the delay, somehow I missed the mail on this report, so the 7.62 > update that went > out won't contain this fix. > > Thanks for the bug report and sample file. > > The problem is that the audio frame sync is further into the file than > exiftool scans. (ExifTool > scans the first 256 bytes, but there are 400 bytes of zeros before the > start of the audio data > in your file). > > I will update the next release of exiftool (7.63) to scan the first 512 > bytes, which will solve > the problem for this file. > > - Phil > > > > >
Hi Kanishka, On Tue Jan 20 02:05:28 2009, koolkanishka wrote: Show quoted text
> I have a query: Isn't MP3 a standard which mentions the details regarding > audio frame sync, where it should be, etc.?
As far as I know, the frame sync can appear anywhere in the file. I think the standard is like this to allow streaming live MP3, but it certainly makes recognizing an MP3 file more difficult. Scanning further into the file to look for the frame sync has 2 problems: 1) It slows down exiftool processing, and 2) It increases the chances of encountering some random data that resembles a frame sync and frame header (I already get enough false positives when looking for MP3 files). So my strategy is to scan no further than necessary, and since I have found no better option, I must resort to guessing and trial-and-error. If anyone knows a more reliable technique to identify MP3 files, I would be very happy to know it. I can't just rely on the file extension because exiftool is designed to work on name-less files like streams and pipes. - Phil
Subject: Re: [rt.cpan.org #42364] "Error: File format error" for an MP3 file (works in Winamp)
Date: Thu, 22 Jan 2009 14:03:39 +0800
To: bug-Image-ExifTool [...] rt.cpan.org
From: Kanishka Banerjee <koolkanishka [...] gmail.com>
Hi Phil, Yes, I can now understand the difficulty involved in processing such files. Thanks, Kanishka Banerjee On 1/22/09, Phil Harvey via RT <bug-Image-ExifTool@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=42364 > > > Hi Kanishka, > > On Tue Jan 20 02:05:28 2009, koolkanishka wrote:
>> I have a query: Isn't MP3 a standard which mentions the details regarding >> audio frame sync, where it should be, etc.?
> > As far as I know, the frame sync can appear anywhere in the file. I think > the standard is like > this to allow streaming live MP3, but it certainly makes recognizing an MP3 > file more difficult. > > Scanning further into the file to look for the frame sync has 2 problems: > > 1) It slows down exiftool processing, and > > 2) It increases the chances of encountering some random data that resembles > a frame sync > and frame header (I already get enough false positives when looking for MP3 > files). > > So my strategy is to scan no further than necessary, and since I have found > no better option, > I must resort to guessing and trial-and-error. > > If anyone knows a more reliable technique to identify MP3 files, I would be > very happy to > know it. > > I can't just rely on the file extension because exiftool is designed to work > on name-less files > like streams and pipes. > > - Phil > > >
I checked another MP3 utility to see what strategy it used. It did essentially the same thing that I was doing, except that it scanned the first 8 kB of the file (by default, but configurable to scan further). So I changed my logic to scan 8 kB too if the file extension begins with MP3. Otherwise go back to only scanning 256 bytes when trying to identify an unknown file type. Hopefully this is a good compromise. Also, I did some extensive testing with about 1000 MP3 files and also found and fixed some other problems related to identifying the audio frame header. So I think the MP3 reader should be much more reliable now. I have just released ExifTool 7.63 with these updates. - Phil
Subject: Re: [rt.cpan.org #42364] "Error: File format error" for an MP3 file (works in Winamp)
Date: Sat, 24 Jan 2009 16:49:33 +0800
To: bug-Image-ExifTool [...] rt.cpan.org
From: Kanishka Banerjee <koolkanishka [...] gmail.com>
Hi Phil, Great.....thanks a lot! -Kanishka On Fri, Jan 23, 2009 at 11:02 PM, Phil Harvey via RT < bug-Image-ExifTool@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=42364 > > > I checked another MP3 utility to see what strategy it used. It did > essentially the same thing that > I was doing, except that it scanned the first 8 kB of the file (by default, > but configurable to scan > further). So I changed my logic to scan 8 kB too if the file extension > begins with MP3. > Otherwise go back to only scanning 256 bytes when trying to identify an > unknown file type. > Hopefully this is a good compromise. > > Also, I did some extensive testing with about 1000 MP3 files and also found > and fixed some > other problems related to identifying the audio frame header. So I think > the MP3 reader should > be much more reliable now. > > I have just released ExifTool 7.63 with these updates. > > - Phil > > >