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: Split mp3 without re-transcoding? (Read 7755 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Split mp3 without re-transcoding?

Hello everyone. Is it possible to split an mp3 without re-transcoding (recompressing or reprocessing)? mp3DirectCut (mpesch3.de) claims on its website that it can split mp3s in a "non-destructive" way, without re-encoding. How true is this? Can mp3DirectCut really generate "untouched" fragments (without generational loss) of the original mp3 file? Is there a way to verify this?

Re: Split mp3 without re-transcoding?

Reply #1
In principe you can't split a MP3. It is simply not a editable format (audio part) so you need to decode it to LPCM first.
However, it uses frames. If you split it using the frames boundaries, you can split it without decoding/encoding.
TheWellTemperedComputer.com

Re: Split mp3 without re-transcoding?

Reply #2
It may be a stupid question, (and it may have probably been asked before) but how can frames be separated without wreaking havoc on the bit reservoir?
• Listen to the music, not the media it's on
• The older, the 'lossier'

Re: Split mp3 without re-transcoding?

Reply #3
As far as I understand, the bit reservoir cannot exceed a full frame, so at least one solution is to put a silent frame first and then throw the reservoired bits in there. (I don't know if that can be done "reversible" with a header that says this frame is not only silent, but not even to be played.)

Re: Split mp3 without re-transcoding?

Reply #4
I've never heard of any issues with Mp3directCut (nor do have a lot of experience with it).

I don't know if they do any "tricks" with the bit reservoir but I wouldn't consider that re-encoding.

...Sometimes your choices are limited if you're stuck with a lossy original.  ;)

Re: Split mp3 without re-transcoding?

Reply #5
Mp3direct cut works very well. It has an automatic mode that will split an mp3 into multiple parts, each the length you enter, whether that be to two parts or 200. However, to get the very best results you need to use the display and place the cut in silences between words. The automatic process sometimes makes a slight hiccup if it comes in the middle of a word. If you are trying to break a long lecture, or any similar things, into more manageable parts that is unlikely to matter but with music it might be enough to bother you.

Re: Split mp3 without re-transcoding?

Reply #6
As far as I understand, the bit reservoir cannot exceed a full frame, so at least one solution is to put a silent frame first and then throw the reservoired bits in there. (I don't know if that can be done "reversible" with a header that says this frame is not only silent, but not even to be played.)
Dunno, I recall reading something back in the day (it may be that Scott Hacker's now-ancient "MP3 - The Definitive Guide) that the bit reservoir could take advantage, up to a certain limit, of whatever free space other adjacent frames may have.

In times like this I wish the "2nd gen" LAME team were still around (who took over from Robert, halb27 et al BTW?).
• Listen to the music, not the media it's on
• The older, the 'lossier'

Re: Split mp3 without re-transcoding?

Reply #7
Hello everyone. Is it possible to split an mp3 without re-transcoding (recompressing or reprocessing)? mp3DirectCut (mpesch3.de) claims on its website that it can split mp3s in a "non-destructive" way, without re-encoding. How true is this? Can mp3DirectCut really generate "untouched" fragments (without generational loss) of the original mp3 file? Is there a way to verify this?

See the notes about lossless editing in WavePad: https://help.nchsoftware.com/help/en/wavepad/win/losslessmp3.html

In summary, they say editing is restricted to frame boundaries, and "audio which is cut-and-pasted can still be saved losslessly, except for a few of the frames on the boundary of a cut-and-paste, which may be re-encoded".  I assume the same applies to the join at a cut.

Video editors work in a similar way: if you set the export as "intelligent re-encode", everything gets passed through from the source video untouched except where it absolutely needs to be re-encoded.
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: Split mp3 without re-transcoding?

Reply #8
ffmpeg seems to be able to do this for a whole lot of formats/codecs, using a special "copy" codec choice, best part about it is it's the same for any format, no need for custom tools with bespoke parameters.
a fan of AutoEq + Meier Crossfeed

Re: Split mp3 without re-transcoding?

Reply #9
best part about it is it's the same for any format
ffmpeg with -codec copy (or -c:a copy) can make a mess sometimes. It is not so likely that people will use it on lossless formats, but if you try it on flac - it seems it will copy STREAMINFO and with wrong length and MD5.

Furthermore, ffmpeg has known issues with end of some MP3s - including end-tags it reads as audio. I don't know whether it does codec copy right when it encounters such streams.

(Also, it only grabs the first audio stream, so if you have multiple ...)

Re: Split mp3 without re-transcoding?

Reply #10
best part about it is it's the same for any format
ffmpeg with -codec copy (or -c:a copy) can make a mess sometimes. It is not so likely that people will use it on lossless formats, but if you try it on flac - it seems it will copy STREAMINFO and with wrong length and MD5.

Furthermore, ffmpeg has known issues with end of some MP3s - including end-tags it reads as audio. I don't know whether it does codec copy right when it encounters such streams.

(Also, it only grabs the first audio stream, so if you have multiple ...)

I've had good luck with ffmpeg joining or splitting mp3s.  YMMV depending on how well the mp3 was encoded and that it's not corrupted in some way. 

With ffmpeg, you can use the -map option.  Say you have a file with 2 audio streams only, you would do something like
ffmpeg -i in.file -map 0:0 -c:a copy -map 0:1 -c:a copy out.file
for whatever format that supports multiple streams.

Edit: I think simply using -c copy will copy ALL streams in the file regardless of type. 


Re: Split mp3 without re-transcoding?

Reply #12
Edit: I think simply using -c copy will copy ALL streams in the file regardless of type. 
Try the attachment. Does with your build?


It does with -map 0 added.  Sorry, I left that out.
Code: [Select]
ffmpeg  -i lotslots.mka -c copy -map 0 lotslots-2.mka

Edit:
You can also combine files with the map option
Code: [Select]
ffmpeg -i lotslots.flac -i lotslots.m4a -i lotslots.mp3 -c copy -map 0 -map 1 -map 2 lotslots.mka

Re: Split mp3 without re-transcoding?

Reply #13
You can also use mp3packer to minimize bit reservoir.
Works best when low bitrate is padded to 320. Very good result with V2 encoded file.

gold plated toslink fan

Re: Split mp3 without re-transcoding?

Reply #14
Surely this is irrelevant if you have no control over the encoding of the source MP3?
It's your privilege to disagree, but that doesn't make you right and me wrong.