[FFmpeg-user] How to add padding silence for MP4 container?

Tom Horsley horsley1953 at gmail.com
Sat May 25 14:45:45 CEST 2013

> So instead of using timestamps with MP4, is there a way to tell ffmpeg to
> insert 2s of silence at the beginning of the audio?

I don't know about using ffmpeg itself, but I fiddle with audio
sync problems all the time and I use sox to generate silence
when I need it. For example:

sox -n -r 48000 -c 2 -e signed-integer -b 16 quiet.wav trim 0 2.0

That will generate 2 seconds of silence in a 16 bit stereo PCM
.wav file format. You can then concatenate that with another audio
file like so:

sox quiet.wav main.wav delayed.wav

I've only ever done this with uncompressed PCM files, don't know
if audio compression might introduce other problems. I tend to
do the mp3 or aac compression as the last step when muxing the
audio and video together with ffmpeg.

See all my trails and tribulations archiving TV shows off my
TiVo (and correcting audio sync) at:


More information about the ffmpeg-user mailing list