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

rgselk rgselknospam at yahoo.com
Tue Oct 7 16:16:56 CEST 2003


--- D Richard Felker III <dalias at aerifal.cx> wrote:
> On Tue, Oct 07, 2003 at 06:13:10AM -0700, rgselk wrote:
> > 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.

In the attached (edited) log I see a 'Samplerate: 48000' in the STREAM
header / WAVE Format. mp3lib/sr1.c prints '32000 Hz'.
I tried mplayer -dumpaudio, but that did not result in a mp3 file at
all. The first 996 bytes of the resulting stream.dump are zero. :-(

It seems the avi header is correct in this case and not the mp3
header...

BTW: I used the attached patch to mplayer.c to be able to really
override the used samplerate. Maybe it is usefull for other people as
well?
Before I had to use '-fps 16 -speed 1.5' to get a watchable movie.

Regards,
  rgselk.


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: samplerate.log.txt
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20031007/b5c796a5/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mplayer.diff.txt
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20031007/b5c796a5/attachment-0001.txt>


More information about the MPlayer-users mailing list