Post

Ffmpeg Cheatsheet

Avoid using online services to remove silence from audio files. (they just want to on sell your email address). If you have homebrew installed the process to remove silence from audio files can be done from your terminal using ffmpeg.

Install:

Open Terminal and install FFmpeg using Homebrew:

1
brew install ffmpeg

Remove Silence:

1
ffmpeg -i input.m4a -af silenceremove=stop_periods=-1:stop_threshold=-40dB output.m4a

stop_threshold=-40dB: Adjust this to the noise level you consider “silence.” stop_periods=-1: Removes all silent parts.

soft silencing

If completely removing silence introduces noise, you can replace silent sections with very soft audio (like low-level white noise). Use the anullsrc filter:

1
ffmpeg -i input.m4a -af "silenceremove=stop_periods=-1:stop_threshold=-40dB,anullsrc=r=44100:cl=stereo" output.m4a
This post is licensed under CC BY 4.0 by the author.