[FFmpeg-user] Input 5.1 DTS, output 2.0 MP3: Atrocious Quality

John L orionfyre at hotmail.com
Sun May 17 09:16:56 CEST 2015



> To: ffmpeg-user at ffmpeg.org
> From: cehoyos at ag.or.at
> Date: Sat, 16 May 2015 11:15:29 +0000
> Subject: Re: [FFmpeg-user] Input 5.1 DTS, output 2.0 MP3: Atrocious Quality
> 
> Moritz Barsnick <barsnick <at> gmx.net> writes:
> 
> > $ ffmpeg -loglevel debug -i inter.dts -ac 2 -c:a libmp3lame -f null -
> > $ ffmpeg -loglevel debug -i inter.dts -ac 2 -c:a pcm_s16le -f null -
> > You can insert other arbitrary codecs at will.
> > 
> > The former shows a matrix:
> > 1.000000 0.000000 0.707107 0.000000 0.707107 0.000000
> > 0.000000 1.000000 0.707107 0.000000 0.000000 0.707107
> > [auto-inserted resampler 0  <at>  0xb713840] ch:6 chl:5.1(side) 
> > fmt:fltp r:48000Hz -> ch:2 chl:stereo
> > fmt:fltp r:48000Hz
> > 
> > while the latter shows:
> > 0.414214 0.000000 0.292893 0.000000 0.292893 0.000000
> > 0.000000 0.414214 0.292893 0.000000 0.000000 0.292893
> > [auto-inserted resampler 0  <at>  0xb3b55c0] ch:6 chl:5.1(side) 
> > fmt:fltp r:48000Hz -> ch:2 chl:stereo
> > fmt:s16 r:48000Hz
> > 
> > I think this may be the described behavior.
> 
> If this really is the issue, it should be reproducible 
> with at least one of the command lines I proposed 
> (namely for -acodec pcm_f32le) and it is possible to 
> work-around the issue by forcing s16p as the mp3 
> encoding format. The mp3 encoder accepts fltp, s16p 
> and s32p.

Thanks Everyone. You've fixed the problem for me. When I cycle through the available format options for libmp3lame, the only one that makes bad audio is 'fltp', both 's16p' and 's32p' produce a good file

> 
> But I would really appreciate if somebody can confirm 
> that the issue is reproducible with pcm_f32le (and 
> neither with s16le nor s32le).
> 
> Carl Eugen
> 

I ran the following command line and received the following:
--------------------------------
ffmpeg -loglevel debug -i inter.dts -c:a pcm_f32le -ac 2 -y inter-f32le.wav
....
[AVFilterGraph @ 0xca9d20] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
1.000000 0.000000 0.707107 0.000000 0.707107 0.000000 
0.000000 1.000000 0.707107 0.000000 0.000000 0.707107 
[auto-inserted resampler 0 @ 0xc965c0] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:2 chl:stereo fmt:flt r:48000Hz
-----------------------------
the resulting wav file is significantly distorted, but qualitatively doesn't 'feel' as harsh

And as you expected, both s16le nor s32le result in acceptable files for both:
ffmpeg -loglevel debug -i inter.dts -c:a pcm_s16le -ac 2 -y inter-s16le.wav
ffmpeg -loglevel debug -i inter.dts -c:a pcm_s32le -ac 2 -y inter-s32le.wav

I quickly re-encoded movies that were known to suffer from this issue using '-c:a libmp3lame -sample_fmt s16p' and they all result in acceptable audio levels.

So OFFICIALLY my problem is resolved. But I'm still curious why it would behave in such a way that fltp->fltp would be allowed to blow out levels so badly (i'm also scared to go down that rabbit hole)

Thank you to all who have contributed. I appreciate your help tremendously.
 		 	   		  


More information about the ffmpeg-user mailing list