13

I have got an mp3 file, let's say it is 25 minutes long. I understand that any software is capable of extracting the first 20 minutes of the file as a new MP3 file. However, I would like to find a solution that would do this "loss-lessly", i.e., keep the original MP3 blocks and just use the first 4/5 of the blocks and modify the header accordingly. This way, no quality loss is imposed by the extraction process. I'm cutting the file in a space where couple seconds of silence happen, so cutting between blocks should be possible.

(A good analogy would be to take a cut-out of a JPG file at the boundaries of the blocks simply by taking only the blocks inside the cutout. One can decode the file, cut it and encode it again, but with a quality loss.)

(As far as I know, by default, software would decode the file into a waveform, extract the demanded part and encode it again using the MP3 algorithm. This is not what I want, since the 2nd compression unnecessarily reduces the quality.)

(I prefer a linux solution, but I can access windows as well.)

10
  • mp3 is not lossless. – DavidPostill Nov 8 '15 at 19:38
  • 4
    @DavidPostill I do know. But each decode-encode step demages the file further; I want to avoid this. I tried to clarify myself. – yo' Nov 8 '15 at 19:39
  • Just that you know, single reencodings quality penalty will probably not be noticed to the human ear. – iTayb Nov 8 '15 at 19:55
  • 1
    What an interesting question. +1 – Dave Nov 8 '15 at 20:10
  • 1
    Just to make this clear: Just cutting the end of an mp3 file will work in the sense that it's playable but most media players will show the wrong duration. @SamiKuhmonen while you are technically correct that the mp3 spec does not include any meta-data specification for the duration, there is a de-facto standard called the XING-header which includes the duration and entry-points for searching in VBR files. – twall Jun 28 '17 at 14:28
6

With linux you can use mp3splt. It has a gui also if you want and is available for linux and windows.

From the man page:

mp3splt is a free command-line utility that allows you to split mp3 and ogg files from several splitpoints, without need of decoding and reencoding.

Extract first 20 minutes from your file:

mp3splt -f original.mp3 0.0 20.0
0
2

mp3DirectCut is for Windows. But the website states that it should work on Linux with Wine.

Not the answer you're looking for? Browse other questions tagged or ask your own question.