Opened 9 years ago

Last modified 9 years ago

#1919 closed defect (fixed)

Bad audio quality with ffmp3float

Reported by:… Owned by: reynaldo@…
Priority: normal Component: af
Version: HEAD Severity: normal
Keywords: Cc: ikalvachev@…, cehoyos, lauri.kasanen@…,…
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:


MPlayer falls back to ffmp3float when mpg123 is not available for decoding, which is how I encountered this. On some MP3s crackling noise seems to appear with this decoder. When using mp3float directly with ffmpeg, the output sounds fine, so it somehow seems to be an MPlayer issue. With -ac mpg123, -ac ffmp3 and -ac mp3 output is fine too. Adding -af format=s16le to prevent mplayer from giving float audio to the ao does not change the result, nor does using -ao pcm.

The directory also contains decoded wave files.

FFmpeg decoding:

MPlayer decoding:

MPlayer playback of decoded .wav files:
The files ?.mp3.mplayer.ffmp3float*.wav exhibit the problem.

System information:

Change History (6)

comment:1 Changed 9 years ago by cehoyos

  • Cc cehoyos@… added

Reproducible with current MPlayer, not reproducible with ffplay.
If I first convert 1.mp3 with ffmpeg's mp3float decoder to wav, the same artefacts can be heard with MPlayer playing the wav file, both aplay and ffplay play the f32 wav file fine.

(I believe the OP did not test mp3float in his FFmpeg tests.)

comment:2 Changed 9 years ago by…

  • Cc… added

Looking at ffmpeg-log.txt, the "[mp3float @ 0x1fcbd40] mdb:418, lastbuf:0 skipping granule 0" lines seem to indicate that mp3float was used. Seems like it converted to non-float before writing the wave file, though.

comment:3 Changed 9 years ago by cehoyos

  • Component changed from ad to af
  • Owner changed from reimar to reynaldo@…

The issue is reproducible with:
ffmpeg -i 1.mp3 -acodec pcm_f32le out.wav (mp3float)
(aplay out.wav plays fine as does ffplay out.wav)
mplayer out.wav -af format=s16le -ao pcm
aplay audiodump.wav (sounds as bad as mplayer 1.mp3 -ac ffmp3float)

An audio filter problem, afaict.

comment:4 Changed 9 years ago by lauri.kasanen@…

  • Cc lauri.kasanen@… added

Still reproducible in r33803, and setting -ac mp3 fixes it for me too.

Could the mp3 default be made mp3lib again?

comment:5 Changed 9 years ago by ikalvachev@…

  • Resolution set to fixed
  • Status changed from new to closed,

It seems some decoders doesn't clip properly the floats in the [-1.0;1.0] range.

In commit r33811, I've added clipping functionality to af_format.c and this seems to fix all issues with the given samples.

Please test.

comment:6 Changed 9 years ago by lauri.kasanen@…

ACK, 33811 doesn't crackle anymore.

Note: See TracTickets for help on using tickets.