[MPlayer-dev-eng] [PATCH] fix for -srate bug
Giacomo Comes
comes at naic.edu
Mon Oct 18 17:53:38 CEST 2004
On Mon, Oct 18, 2004 at 11:16:01AM -0400, D Richard Felker III wrote:
> On Mon, Oct 18, 2004 at 10:25:56AM -0400, Giacomo Comes wrote:
> > > > > > This code went in 2004-01-27 and it's what cause the problem with -srate.
> > > > > > Can somebody explain if it can be safely removed or it has to stay but it needs
> > > > > > some modification?
> > > > >
> > > > > Good question. Is there somebody out there who cares about af ?
> > > >
> > > > Anyone out there ?
> > >
> > > the original code is correct as far as i can tell. if someone claims
> > > it's a bug they need to explain why, not just send a patch.
> > >
> > > rich
> >
> > I did explain why and I reported the bug more than one time.
> > This is the first time that I see a comment on it except for the request
> > of Attila.
> >
> > Here is the explanation of the bug:
> >
> > Listen with mplayer 1.0pre4/5 the first 10/15 seconds of this video:
> > mplayer -nocache http://www.telenorba.dyrecta.com/video/tnnews56/18010.asf
> > the audio is 8000 Hz.
> > Now do the same with -srate:
> > mplayer -nocache http://www.telenorba.dyrecta.com/video/tnnews56/18010.asf -srate 44100
> >
> > Do you hear any difference? I do if I do not apply the patch I submitted.
> > The resampling introduce a distorsion in the audio.
> >
> > I have seen the distorsion expecially with 8000 Hz samples when I resample at 44100 Hz.
> > But id doesn't appear with ALL the 8000 Hz samples.
> > I have seen it also with audio samples with higher
> > sample rate, but in that case it's more difficult to hear the distortion.
> >
> > This bug has been confirmed at least by one other user.
> >
> > if you need more details please ask me.
>
> with the fast option, there's supposed to be distortion. set it not to
> use fast mode if you want good resampling. imo your code disables the
> fast option entirely so it will be slow on my computer!! :(
>
Ok, this solve part of my trouble.
The complete story is here.
There are three mode of using the resample filter:
1) mplayer 18010.asf -af resample=44100:0:0 (fast mode with distortion)
2) mplayer 18010.asf -af resample=44100:0:1 (normal mode without distortion)
3) mplayer 18010.asf -af resample=44100:0:2 (normal mode without distortion but with some noise)
It looks to me that:
mplayer 18010.asf -srate 44100
is equivalent to mode 1 and
mplayer 18010.asf -af resample=44100
is equivalent to mode 2
So using -srate 44100 turn on fast mode, but using only -af resample=44100 doesn't.
I wated to use mencoder with -srate 44100 and got distortion.
mecoder -af resample=44100 didn't work.
But now I have seen that if I use:
mecoder -af resample=44100 -srate 44100
it works and select mode 2. So if I use -af resample togheter with -srate
I can control the resampling in mencoder.
This should go in the documentation, or mencoder should be fixed and be able to use
-af resample without -srate.
With this trick I don't need to apply my patch anymore.
Thanks.
Giacomo
More information about the MPlayer-dev-eng
mailing list