[MPlayer-users] Playing severely damaged MP3 file

The Wanderer inverseparadox at comcast.net
Mon Jul 7 15:35:53 CEST 2008


This is not strictly on-topic for these mailing lists, but there is a
fair chance that someone here will be able to answer, and for a "once in
several years" thing I think it's worth the offense.

I have a small (and mostly unmarked - I can only easily identify one of
them) number of MP3 files which once played fine but which have, by some
unknown means, had sizable blocks of data overwritten by zeros. In the
one case I can easily identify as having the problem, this is roughly
1.3MB worth out of 60MB total, divided among at least three different
places in the file - one of them at the very beginning.

I understand and accept that the data which has been replaced by the
zeros is gone and unretrievable. What I would like to do is to be able
to play the remaining data, even if with missing segments and audible
artifacts and so forth.

I have written a program to remove all blocks of zeros larger than a
specific value (which I have set as 512, since there are recurring - and
thus apparently legitimate - blocks of 382 zero bytes late in the one
known bad file). With those zeros removed, file, mpg123 and libavformat
all recognize the file as an MP3; file reports 'MPEG ADTS, layer III,
v1, 128 kbps, 44.1 kHz, Stereo', and mpg123 and mplayer both try to play
it. The latter two also print the title, artist, album, and related info
without complaint, so presumably the file header is present and at least
relatively undamaged. However, the file does not successfully play.

Both mpg123 and mplayer flood the console with error messages; mplayer's
default output is below (with the file's identifying information
modified to protect the paranoid) but does not look particularly
informative, at least not for someone without the file on hand to
examine in detail. mpg123 and mplayer with the default codec (mp3lib)
produce staticky, garbled sound; mplayer with '-ac ffmp3' produces
mostly silence and occasional small sounds, resembling the scratchy
sound of a skip on a vinyl record.

What are the chances of there being anything which can be done to
recover or repair this file such that it is playable again? I'm not even
completely sure that I'm on the right track removing the zeros (since
there is a smaller but still large block of them near the beginning of
at least one other file which plays fine), except that the file is not
recognized as MP3 at all without them removed.

Any advice appreciated.


wanderer at archon:/tmp$ mplayer redacted.mp3
MPlayer dev-SVN-r27138-4.3.1 (C) 2000-2008 MPlayer Team
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 5000+ (Family: 15, Model: 
107, Stepping: 2)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2

Playing redacted.mp3.
libavformat file format detected.
[mp3 @ 0x88437b0]big_values too big
invalid new backstep 407
mdb:501, lastbuf:413 skipping granule 0
overread, skip -6 enddists: -1 -1
overread, skip -7 enddists: -3 -3
[lavf] Audio stream found, -aid 0
Clip info:
  name: redacted
  author: redacted
  comments:
  album: redacted
  genre: redacted
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
big_values too large!
big_values too large!
big_values too large!
big_values too large!
mpg123: Can't rewind stream by 525 bits!
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
mpg123: Can't rewind stream by 529 bits!
big_values too large!
big_values too large!
mpg123: Can't rewind stream by 72 bits!
big_values too large!
big_values too large!
mpg123: Can't rewind stream by 2735 bits!
mpg123: Can't rewind stream by 90 bits!
big_values too large!
big_values too large!
big_values too large!
big_values too large!
mpg123: Can't rewind stream by 1308 bits!

[ .... ]

mpg123: Can't rewind stream by 115 bits!
mpg123: Can't rewind stream by 14 bits!
big_values too large!
big_values too large!
mpg123: Can't rewind stream by 996 bits!
A:   2.2 (02.2) of 3783.3 ( 1:03:03.3)  1.8%
Exiting... (Quit)

-- 
       The Wanderer

Warning: Simply because I argue an issue does not mean I agree with any
side of it.

Secrecy is the beginning of tyranny.



More information about the MPlayer-users mailing list