[FFmpeg-user] generating silent audio duration is not accurate

Paul B Mahol onemda at gmail.com
Fri Sep 20 01:57:16 CEST 2013


On 9/19/13, Jeanne Rich <jrich at laika.com> wrote:
> Hi, I'm trying to generate some silent audio - equivalent to 1 frame of
> video and a 48000 sample rate. I specify the duration with the -t option and
> set that to 0.041667 which is equivalent to 2000 audio samples. I am not
> doing anything fancy with the codec, simply creating pcm_s16le. The
> returning wav file has a duration of 0.042667 which is 2048 samples. Is this
> a bug? or am I doing something wrong? I also tried -frames:a 2000 and that
> gave me something that was 42 seconds long.
>
> I would really like to see this work accurately, at this point I am going to
> have to revert my code to use sox instead.

Use atrim filter. It can trim at exact number of samples.


More information about the ffmpeg-user mailing list