[FFmpeg-user] Audio resampler (SoX) returns different result
Moritz Barsnick
barsnick at gmx.net
Mon Nov 19 16:02:02 EET 2018
Hi,
On Mon, Nov 19, 2018 at 16:14:03 +0800, 林至善 wrote:
> I need a down-sampled(=8kHz) version of my input.wav file (=16kHz).
>
> According to
> https://trac.ffmpeg.org/wiki/FFmpeg%20and%20the%20SoX%20Resampler,
> I use the command below
>
> ffmpeg -i In16k.wav -af aresample=resampler=soxr -ar 8000 Out8k.wav
>
> It works well, but I found that every time I run the command above,
> it returns the "Out8k.wav" with a slightly different(in PCM value).
Interesting. But first of all, I believe your command line is wrong.
"-ar" uses ffmpeg's native resampler, I believe. Using the filter, you
need to pass the rate to the filter itself:
ffmpeg -i In16k.wav -af aresample=resampler=soxr:sample_rate=8000 Out8k.wav
You could also just use any other resampler, e.g. by omitting "-af
aresample=resampler=soxr" fully.
I don't have soxr support, so I can't reproduce your issue. It should
be deterministic. Perhaps some metadata thing.
> *If I want a resampler which always returns the same result, how can I do?
Can you try whether the command line option "-bitexact" changes
anything?
Moritz
More information about the ffmpeg-user
mailing list