[MPlayer-users] How to correct samplerate of mp3 stream in avi?

D Richard Felker III dalias at aerifal.cx
Tue Oct 7 15:34:22 CEST 2003


On Tue, Oct 07, 2003 at 06:13:10AM -0700, rgselk wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Hi there,
> 
> I have an avi file with a mp3 stream which is claiming to have a
> samplerate of 32kHz. However this should be 48kHz. The two bits in the
> header indicating the frequency (bit 10,11) now read '10' and should
> read '01'.
> Is there a tool to modify this direct? Or else how do I know the offset
> of this header, so I can write a small perl script to do the
> manipulation.

Are you sure this is the problem? The samplerate is also stored in the
avi header, so IMO it's much more likely that it's correct in the
actual mp3 stream and wrong in the avi header. Try dumping the mp3
stream with -dumpaudio and check that it plays correctly. Dumping also
has the effect that you can write down the first few bytes of the mp3
stream, then search for them with a hex editor in the avi file, in
case you do end up needing to edit the mp3 stream.

On the other hand, if it's the avi header you need to edit, just
search with a hex editor for the first occurrance of 32000 (little
endian) in the avi file and change it to 48000.

Rich



More information about the MPlayer-users mailing list