Linux – How to you trim mp3 files using `ffmpeg`

ffmpeglinuxmp3

Here is a Linux audio MP3 puzzle that has been bugging me for awhile:

How to trim the beginning few seconds off an MP3 audio file? (I can't get ffmpeg -ss to work with either 00:01 or 1.000 format)

So far, to do what I want, I resort doing it in a GUI manner which is maybe slower for a single file, and definitely slower for a batch of files.

Best Answer

For editing mp3's under linux, I'd recommend sox. It has a simple to use trim effect that will do what you ask for (see man sox for datails - search (press/) for "trim start"). Example:

sox input.mp3 output.mp3 trim 1 5

You didn't mention it, but if your aim is just to remove the silence at the beginning of files, you will find silence effect much more useful (man sox, search for "above-periods")

Related Question