FFmpeg 3.4.13
Since* 1.1
#

Pad the end of an audio stream with silence.

This can be used together with ffmpeg-shortest to extend audio streams to the same length as the video stream.

A description of the accepted options follows.

packet_size

Set silence packet size. Default value is 4096.

pad_len

Set the number of samples of silence to add to the end. After the value is reached, the stream is terminated. This option is mutually exclusive with whole_len.

whole_len

Set the minimum total number of samples in the output audio stream. If the value is longer than the input audio length, silence is added to the end, until the value is reached. This option is mutually exclusive with pad_len.

If neither the pad_len nor the whole_len option is set, the filter will add silence to the end of the input stream indefinitely.

#

Examples

  • Add 1024 samples of silence to the end of the input:

    apad=pad_len=1024
  • Make sure the audio output will contain at least 10000 samples, pad the input with silence if required:

    apad=whole_len=10000
  • Use ffmpeg to pad the audio input with silence, so that the video stream will always result the shortest and will be converted until the end in the output file when using the shortest option:

    ffmpeg -i VIDEO -i AUDIO -filter_complex "[1:0]apad" -shortest OUTPUT