If you rip a CD in Ubuntu 12.04+ using the default program provided for this (Rhythmbox), the track lengths will be incorrect. This is because by default, Ubuntu will rip your mp3s using VBR, but it doesn't add the VBR headers.
Rather than go into the details, here's the easiest way to fix it:
- Install vbrfix by running this command in a terminal:
sudo apt-get install vbrfix
- Now CD to the folder where the mp3s are that you need to fix:
cd /path/to/mp3s
- Run this command to add the VBR headers to the mp3s:
find . -type f -iname '*.mp3' -exec vbrfix {} {} \;
- Vbrfix seems to leave behind a couple of temporary files, so clean them up:
rm vbrfix.log vbrfix.tmp
Another option would be to change the default preset to make it CBR. You can read more about doing that here:
How do you edit the “Preferred Format” settings in Rhythmbox? Something like this ought to do the trick (change the bit rate as desired):
[mp3-cbr]
name=lamemp3enc
target=bitrate
bitrate=192
cbr=true
encoding-engine-quality=high
mono=false
You can read the details of the problem at this bug report:
Rhythmbox does not add VBR headers when ripping CDs to MP3