If I have an audio file in .wav format, I can run sox on it as follows :
sox in.wav out6.wav silence -l 1 0.1 1% -1 2.0 1% and this command works really really well for removing silence.

Is there some similar command that I can use in ffmpeg?

At the moment, I'm converting from .mp4 to .wav by doing
ffmpeg -i input.mp4 output.wav

and then doing the sox silence removal command.

What I want to do is, not shorten the audio but keep the silenced out regions in the audio as empty portions/pauses.



This filer discards samples below a threshold (in deciBels), silence period can be shrinked to a certain interval.

From the FFmpeg manual:

The following example shows how this filter can be used to start a recording that does not contain the delay at the start which usually occurs between pressing the record button and the start of the performance:

ffmpeg in.mp4 -filter:a "silenceremove=start_periods=1:start_duration=5:start_threshold=0.02" out.mp4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.