Ruben Laguna's blog

Nov 1, 2009 - 1 minute read - Comments - encode incorrect itunes lame length mp3 reencode wrong

Incorrect track length in iTunes

iTunes was reporting a incorrect track time length for an audiobook that I created concatenating several mp3 together.

I had to reencode the whole thing again to make iTunes recognize propertly the track lenght. I could’t reencode the concatenated file itself as that ended up with a Segmentation fault in lame

cat *.mp3 |lame --mp3input - - >resultfile.mp3

cat *Night.mp3 |lame --mp3input -  down.mp3
ID3v2 found. Be aware that the ID3 tag is currently lost when transcoding.
LAME 3.98.2 64bits (http://www.mp3dev.org/)
Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
Encoding <stdin> to down.mp3
Encoding as 44.1 kHz single-ch MPEG-1 Layer III (11x)  64 kbps qval=3
bitstream problem: resyncing...
bitstream problem: resyncing...
bitstream problem: resyncing...
bitstream problem: resyncing...

This uses the lame streaming mode, decodes the input stream (all mp3 concatenated) as mp3 and then reencodes it as mp3. Although it complains about “bitstream problem: resyncing...”, the resulting mp3 sounds fine.

Disable DOM DTD validation How to handle custom tags using Flying Saucer