[FFmpeg-devel] Simplify use of audio_resample

Clément Bœsch ubitux at gmail.com
Tue Oct 25 10:38:13 CEST 2011


On Tue, Oct 18, 2011 at 12:42:13PM +0200, Michael Niedermayer wrote:
> On Tue, Oct 18, 2011 at 10:17:57AM +0200, Clément Bœsch wrote:
> > Hi,
> > 
> > I'm not sure to understand the motive of having some audio_resample heuristics
> > in transcode_init() and more in do_audio_out() (with some duplicates); if there
> > is no particular reason for this, the first patch is meant to regroup the
> > audio_resample R/W into do_audio_out() only.
> > 
> > Then the flag is just removed from OutputStream in the second patch since it
> > does not seem needed anymore.
> > 
> > I guess more simplifications could be done, but before I eventually try that I'd
> > like to know if I'm not missing any particular special cases since that part of
> > the code isn't quite obvious.
> > 
> > fate seems ok, but I'm not sure there are some tests for this.
> 
> please test with some file that changes its audio parameters mid stream
> it should work to just concatenate 2 mp3 or mpeg-ps with diffenrent
> parameters

Given two mp3 with 1 minute length, one at 44100Hz and the other at
8000Hz, the outputs of the following command differ:

  ffmpeg -i 'concat:sample-1min-44100Hz.mp3|sample-1min-8000Hz.mp3' -y out.wav

With ffmpeg/master, the resample is not done for the second part (so the
second audio part sounds insane), even with -ar 44100. Does it make any
sense to do so, even for lossless purpose? Also note, the duration of the
output is 1min10.

After the patches, the resampling flag being set when the frequency
change, the output is 2min long, with the second part in good shape.

So what is the intended behaviour?

If the first one is really what we want, I'll drop these patches and
will resend a map_channel patch rebased on master. But is it possible to
have more insight on the purpose of such behaviour?

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111025/6cd6e5a4/attachment.asc>


More information about the ffmpeg-devel mailing list