Cut mp3 files in Linux terminal

Default featured post

If you have mp3 filees and want to split them or extract few seconds out of them, you can use either mp3cut or ffmpeg applications in terminal hassle-free. I found these two fantastic tools on UbuntuGeek and Askubuntu websites. Let’s go through each of them and see how each works.

Mp3cut

Mp3cut is an easy application to use. You just need to give few parameters to cut mp3.

For example,

$ mp3cut -o s1.mp3 -t 00:20-00:00:40 gangester.mp3 

In this example firstly you should determine output file with -o parameter and then starting time which in this example is 00:20 and then ending time which is 40, plus original file name.

This means that 20 seconds of track is extracted from 20 to 40.

FFmpeg

Now let’s see how FFmpeg works. We are going to repeat the same above task.

$ ffmpeg -i gangester.mp3 -t 00:00:20 -ss 00:00:20 -acodec copy s1.mp3

It is almost similar except the file order which you should identify input file first and then output file and one more important thing which confused me at first is that, after -t parameter you should write duration which you want to cut (like 20) and then identify starting point after -ss argument.

Finally, I just want to add that, with FFmpeg you are able to convert audio and video file(s) as well.

For more information see the man pages of both applications.