Re: Fix mp3 file preserving duration

Depends in what way it is corrupted. Also depends how the MP3 file was encoded. If it's a VBR file, you're kinda out of luck. When parts are unreadable it is impossible to tell the duration of the corrupted section. If it's CBR and the header is intact, you could perhaps reject parts of the file by calculating an assumed timeframe. If there is software that'll do it for you I don't know, but I remember FFmpeg could skip over broken sections of a file when reading. However I'm not sure whether is it capable of reencoding that file into some other format (such as simply decompressing it), while doing it. Especially not if it's able to preserve putting sections at correct points in time.

Re: Fix mp3 file preserving duration

It's VBR, the header is OK.An only useful tool I was able to find it's mp3DirectCut.Using "Check for re-syncs" and then "Save split" it splits the bad mp3 file by those broken parts removing corrupted packets at the end of the each segment. Then using timestamps from Cue (created by "Check for re-syncs") it's possible to calculate differences between duration of original segments and splitted parts, create "patches" using ffmpeg -f lavfi -i anullsrc... , concatenate them back to one file.But it's such a tedious job.Maybe there is an better way? Some tool? I can't believe that nobody has faced this sync problem before.

Re: Fix mp3 file preserving duration

Yeah, MP3 players would silently ignore whatever they couldn't understand, and so when utilities would make all sorts of junk, the developer would never be yelled at, and so it went on ... It does not help that the old ISO mp3 is a really shitty format (*cough* gaplessness ...), which invited all sort of "non-standard enhancements" retrofit into it.

(Before I get TOS#8 thrown at me: I didn't say mp3 streams are bad to listen to, but the file format sucked big time.)