FFMpeg – How to Trim Silence from Beginning and End of MP3 Files

audioffmpegmp3

After investigating to find a solution to the problem, I ended up empty-handed.
I want a context menu option in Windows 10 so that whenever I right click on a mp3 file I have this option to trim silences from start and end of mp3 files. I don't want to remove silences from middle parts of audio files.
Can anyone please provide me with the appropriate command line of FFmpeg to remove silences only from beginning and end of mp3 files?

Best Answer

Something like this:

ffmpeg -i input.mp3 -af "silenceremove=start_periods=1:start_duration=1:start_threshold=-60dB:detection=peak,aformat=dblp,areverse,silenceremove=start_periods=1:start_duration=1:start_threshold=-60dB:detection=peak,aformat=dblp,areverse" output.flac

You'll need to adjust both thresholds (start_threshold) and durations (start_duration) to your specific case.

Related Question