FFMPEG how to trim silence and generate MP3

I happen to be in the situation where I build VCVRack patches on Linux without access to a wave editor.

But I do have the swiss army knife of command line audio tools: ffmpeg

Two recipes:

  1. ffmpeg -i inputaudio-file -af silenceremove=1:0:-50dB outputaudio-file where inputaudio-file and outputaudio-file are replaced with your actual audio filenames.

  2. ffmpeg -i inputaudio-file -b:a 320k outputname.mp3 Generates a 320K MP3 file from your input.

Well a 3rd recipe – you can trim silence and output an MP3 file in one step:

  1. ffmpeg -i inputaudio-file -af silenceremove=1:0:-50dB -b:a 320k outputaudio.mp3
5 Likes

the output is a video file or only the mp3 layer?

mp3

1 Like

David I haven’t tried this on a video, but I imagine it could trim silence from videos too!

EDIT: LOL it kinda doesn’t seem to work correctly. It does trim the silence at the start of the audio but if you look at the master fader that I bring up, it trimmed the audio without trimming the video, so the audio and video are not in sync.

1 Like

Stop wasting time on the forums and put out v. 1.0.9. :stuck_out_tongue_winking_eye::stuck_out_tongue_winking_eye::stuck_out_tongue_winking_eye::stuck_out_tongue_winking_eye:

1 Like