Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Cutting an MP3 gaplessly without re-encoding. (Read 18716 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Cutting an MP3 gaplessly without re-encoding.

Greetings all!

This is my first forum post here, although I have been a reader for a while now. I ran into a dilemma recently. I purchased an album off of BandCamp that included a bonus track, but the problem is that they made the last track and the bonus track one file rather than splitting the bonus track into it's own separate file. I'm a perfectionist, so naturally I went about trying to find a program that could cut the mp3 into two separate tracks without compromising quality. This was harder than I imagined.

Most programs that claim to split audio files without re-encoding don't actually do it flawlessly. The data isn't encoded in a truly gapless way, and this bothers the hell out of me. I've referred to several old threads here on the board (Which I will link to in a second) and they all seem to recommend a problem called "pcutmp3" which has been dead since 2009:

http://www.hydrogenaudio.org/forums/index....showtopic=62757
http://www.hydrogenaudio.org/forums/index....showtopic=73064

I've tried to run the most recent release (0.98 Beta), but to no avail. I just get an error message that states that "a java exception has occurred". I'm running a PC with Windows 7 Home Premium, 64-bit installed. And as explained in the previous threads, programs like Medieval CUE Splitter and mp3Directcut just don't do the job.

So my question is... Are there any other programs today that are able to do what I need, i.e., splitting an mp3 file into two separate files WITHOUT re-encoding them, AS WELL AS making the resulting files play back gaplessly? Surely in the three years since those threds were posted at least one other program has been developed that can do what pcutmp3 used to do, right?

Any suggestions would be tremendously appreciated.

Cutting an MP3 gaplessly without re-encoding.

Reply #1
mp3splt
mp3DirectCut

Oops, you mentioned the latter. Still, those are the ones I know. I concede that I’m not aware of any issues regarding subsequent gaplessness or the lack thereof, so YMMV. Other users may have more specific info for you.

Cutting an MP3 gaplessly without re-encoding.

Reply #2
1) Try an earlier version of pcutmp3.  It's been awhile since I've used it, but I also ran into Java errors, and IIRC, one of the earlier versions worked while 0.98 didn't.

2) Be aware that the way pcutmp3 cuts MP3's "gaplessly" is by writing new encoder delay and padding values into the LAME/Xing tag.  Those values can often be unusually large, and some players may not be able to cope with them, and that's assuming you're using a player that actually reads those values and implements them in the first place.
"Not sure what the question is, but the answer is probably no."

Cutting an MP3 gaplessly without re-encoding.

Reply #3
I've tried using the previous version of pcutmp3 and it doesn't work either, unfortunately. I'm a real stickler for preserving audio quality, even when in mp3 form, and I want to be sure that whatever program I use will not degrade the quality of the resulting tracks in any way. If at all possible, I want them to be perfect binary equivalents of the original joined file. Surely, something out there can do this, right?

Cutting an MP3 gaplessly without re-encoding.

Reply #4
Bandcamp require lossless uploads from the artists (though whether they're actually lossless or transcoded depends on the uploader, obviously) and I was under the impression that buyers had lossless download options for every purchase. If so, just pick the FLAC version of the last track, cut it in an audio editor and encode it to MP3 yourself.

Cutting an MP3 gaplessly without re-encoding.

Reply #5
I'm a real stickler for preserving audio quality, even when in mp3 form, and I want to be sure that whatever program I use will not degrade the quality of the resulting tracks in any way. If at all possible, I want them to be perfect binary equivalents of the original joined file.

It's been a very long time since I played with cutting and reattaching mp3 tracks losslessly and remember there being a lot of different methods over the years.  So long as the solution doesn't involve decoding and then re-encoding (none of the solutions offered do this, so not to worry) then there will be no degradation in quality. Non-gapless cutting merely adds a very tiny fraction of a second of silence and fail to provide your media player information about how to connect the tracks seamlessly upon playback (assuming it would otherwise be able to do so).  If the cut is performed over a transition that is already silent then this is a non-issue.

Cutting an MP3 gaplessly without re-encoding.

Reply #6
pcutmp3 0.97.1 is working OK for me in Win7 64-bit with 64-bit Java 1.7.0_15.

When you cut an MP3 with any of the regular cutters (not pcutmp3), or if you use the never-fully-implemented --nogap options in LAME (cutting at encode time), you're rendering a small number of samples on either side of the cut point unreachable and/or improperly decodable, because every frame partially depends on adjacent frames.

This imposes playback requirements that currently almost zero players implement: reassembling the files beforehand (obviously requires some knowledge of what files belong together), or at least not resetting the decoder in between files, and reading the very end/beginning of adjacent files or dummy data in order to reach and properly decode the samples on each side of the cut points.

pcutmp3 fudges the MP3s a bit to attach part of the adjacent files to the current one and then tag the whole thing with gapless playback info that is widely supported, and that's as good as it gets. I hope you can get it working.

The people who make MP3 decoders and players are just not very interested in supporting what you really want, at least not without patches and test cases and some serious thought, and that's only for those that are open source.

Cutting an MP3 gaplessly without re-encoding.

Reply #7
@Cynic: That's true. In fact, that was what I actually tried that first. However, taking the FLAC version of the album, splitting the last track, and then converting the resulting files to mp3 results in the (slight) loss of audio quality when compared to the waveform of the MP3's that BandCamp provides. Hence, why I attempted a different solution.

@Greynol: You are indeed correct. I used the program "mp3splt" from command line and though it took some time to figure out, it worked perfectly. I used Audacity to compare the waveform and the difference is nonexistent. I also used your earlier suggestion (from your PM) of using mp3DirectCut, but the result was a file that had an audible hiccup about two seconds into each track. I think I can safely say this issue has been resolved satisfactorily.

Cutting an MP3 gaplessly without re-encoding.

Reply #8
However, taking the FLAC version of the album, splitting the last track, and then converting the resulting files to mp3 results in the (slight) loss of audio quality when compared to the waveform of the MP3's that BandCamp provides.


Does this mean you evaluate the audio quality by eye ...?

Cutting an MP3 gaplessly without re-encoding.

Reply #9
I have no idea which encoder and what settings bandcamp uses, but in general, encoding to whatever you want from lossless is definitely the preferred route.

Cutting an MP3 gaplessly without re-encoding.

Reply #10
@Porcus: Yes, indeed. That's always my preferred method. I always try to look at the waveform as well as the spectrograph to analyze track quality. The human ear is fallible, but you can easily compare two different tracks visually to see if they differ. I do listening tests before and after as well though, if that's what you're getting at.

@Greynol: So you're suggesting that my best option would have been instead to have used the FLAC copy, split the last track of that version using CueTools, then convert all the files to mp3? As opposed to just splitting one mp3?

Cutting an MP3 gaplessly without re-encoding.

Reply #11
Yes, that is what I'm suggesting.

I would also advise that you re-evaluate your position on the sighted evaluation of perceptual encoders.  There are plenty of existing discussions about why already.  This or just accept that it is simply not allowed here. 

Cutting an MP3 gaplessly without re-encoding.

Reply #12
@Greynol: Fair enough. Perhaps you could link to one of the relevant threads on the issue, though? I'd like to read an explanation of why exactly that is. If not, no matter. I'll just take your word on it.


Cutting an MP3 gaplessly without re-encoding.

Reply #14
mp3splt has a gui.

Cutting an MP3 gaplessly without re-encoding.

Reply #15
The OP omitted to respond to my previous post containing a recommendation of that program, but maybe it’ll register this time.

Cutting an MP3 gaplessly without re-encoding.

Reply #16
I don't think they're gapless in the way that pcutmp3 is gapless. Aren't they restricted to whole frames?

pcutmp3 manages to be gapless and glitchless in a way that no encode-per-track lossy encoder (even the so called natively gapless ones) can be (unless they overcode start and end frames to be near-lossless and/or mirror/duplicate the audio around the track split point to give the encoder a longer clean frame, which doesn't always work).

Is there anything comparable with pcutmp3 available for other lossy codecs? (I'm only asking out of interest.)

Cheers,
David.

Cutting an MP3 gaplessly without re-encoding.

Reply #17
mp3splt does the same thing for Vorbis, too. I don’t know whether lossless cutting is possible for AAC.

Cutting an MP3 gaplessly without re-encoding.

Reply #18
Wait, mp3split is gapless (and glitchless)?

To this idea of using pcut over encoding tracks individually because it is glitchless, I suppose you need to take into account player compatibility.  IIRC, we're talking about having to skip over ~10x as many samples.

Cutting an MP3 gaplessly without re-encoding.

Reply #19
Gapless/glitchless mp3 decoding has patchy player support anyway.

I guess if you were targeting least bad performance on most possible players (rather than perfect performance on a few players) your choice would be different.

The whole thing just makes me use (lossy)FLAC. Even then, player support isn't great, but I know I can't do any better (other than encode gapless albums as single tracks).

Cheers,
David.

Cutting an MP3 gaplessly without re-encoding.

Reply #20
All the MP3 splitters cut on frame boundaries. pcutmp3 is the only one that overlaps (includes extra frames on either side of split points) and then rewrites the LAME tags with correct delay & padding values.

mp3splt doesn't do anything fancy; it's not gapless/glitchless. It splits as close to the desired point as possible, but doesn't rewrite LAME tags. Instead, it just copies the original file's LAME tag into every output file, so the delay & padding values are never both correct. That is, the delay is only correct in the first file, and the padding is only correct in the last file.

Ideally, the padding value would be changed to 0 in all but the last file, and the delay value would be changed to 0 in all but the first file. But then you run into the problem that basically no players support padding values that are less than the decoder delay (529), hence the advantage of pcutmp3's method (though apparently there's some issue with padding values being too big?) ... it at least works in some players, and should be seamless despite the decoder reset between files.

Cutting an MP3 gaplessly without re-encoding.

Reply #21
That was exactly what I was getting at. Maybe I worded it poorly in my OP, but a lot of people seemed to miss my point on that. To add emphasis, Mp3splt worked well enough but it wasn't actually what I was looking for.

Cutting an MP3 gaplessly without re-encoding.

Reply #22
If the cut was performed over a period of silence between the end of the last track and the beginning of the bonus track then any splitting program should be good enough.  I've never seen bonus content pinned to the end of the last track that wasn't preceded by silence.

Cutting an MP3 gaplessly without re-encoding.

Reply #23
How about mptrim? You can first delete part 1 and then part 2 from the original file.

Cutting an MP3 gaplessly without re-encoding.

Reply #24
How about mptrim?

The OP asked about editors that produce MP3s that play back "gaplessly"—i.e., with no risk of an audible seam where the edit was made. As I mentioned, only pcutmp3 satisfies this requirement. mptrim does not. (And as Greynol mentioned, if you're cutting in the middle of silence, it doesn't need to be gapless.)