1

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.

0

silenceremove

This filter cuts off the silence from the audio as the silence threshold is in dB. It's like the SoX's silence removal effect. It trims the silence period to specified seconds.

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.