Categories: Misc / DotNet / Java / Coder / Linux / PHP Ask - La ask - La Answer

Im having trouble going from MP3 to AAC

I'm following the guides posted on this forum but I keep running into the same problem. Say I have a 30min MP3 file, when I convert it to AAC it turns into a 4 minute file. Any idea what's going on here? If I'm doing something wrong please let me know so I can fix it. Thanks in advance
[305 byte] By [Cution] at [2007-11-10 22:04:01]
# 1 Re: Im having trouble going from MP3 to AAC
Have a look at
http://forums.ipodlounge.com/showthread.php?s=&threadid=13294&highlight=incorrect+time+length and
http://forums.ipodlounge.com/showthread.php?s=&threadid=27252&highlight=incorrect+time+length

what version of iTunes, iPod updater, iPod firmware? Is the aac file really only 4 minutes? It may be that it is 30 minutes, but thread says that incorrect time screws up bookmarking or returning to proper place in file. Also, one of the threads above says that playing vbr files in iTunes fixes the incorrect time. If you already have it on your iPod, clear it and resynch or manually add.

You will probably get a better answer from others, but thought this worth the try -- did an iLounge search on "incorrect time length" by thread and by post (requires using the search button) to find these that I vaguely recalled .
robert at 2007-11-15 17:35:39 >
# 2 Re: Im having trouble going from MP3 to AAC
Thanks for those links, Robert. This explains some of the bizarre behaviour I was getting with long MP3 files with an Xing (VBR) tag at the start.

If it fixes this problem, I might even upgrade to iTunes 6 in another week or so when I reckon it's safe (I see Apple was forced to rush out a version 6.0.1 already!).
david1951 at 2007-11-15 17:36:38 >
# 3 Re: Im having trouble going from MP3 to AAC
David,

Robert's posted links about problems being fixed in a newer version of iTunes date from October and November 2003 -- so upgrading to iTunes 6 may not help with your problem.

Cution, there is a problem with some mp3 headers and playback time under iTunes, and this could affect your conversion. It's usually been reported when variable bit rate encoded mp3 files created with a 3rd party application play back with the wrong time length on your iPod. Have you seen problems when playing back the mp3 files on your iPod? (If you played the files under iTunes on your computer, the length may have been corrected in your iTunes Music Library database file even though it has not been corrected in the mp3 file headers. In that case, it's possible you wouldn't notice the problem playing the mp3 files in iTunes, but would have a problem when you convert the file to another format).

See this vbr-mp3-fix web page (http://txfx.net/2005/02/08/vbr-mp3-fix/).Excerpted from VBR Mp3 Fix February 8, 2005
...iTunes uses an old school "header" to designate VBR (Variable BitRate) files...If your VBR files don't have the header, you are going to have problems, such as not being able to seek through your files, having files cut out prematurely, and having an incorrect total time reported.

Related posts in the Books and Spoken Word forum showed up in this discussion (http://forums.ilounge.com/showthread.php?s=&postid=697633#post697633) that references David's problems (October 1, 2005), and this (http://forums.ipodlounge.com/showthread.php?s=&postid=642675#post642675) August 1, 2005 discussion about mp3 headers.

The vbr-mp3-fix web page (http://txfx.net/2005/02/08/vbr-mp3-fix/) gives a link to a program that runs on Windows and linux that can fix the header, if this is the source of your problem, and if you are using Windows.

Edited to add date (February 8, 2005) of the vbr-mp3-fix page posting, to clarify that this is an ongoing mp3 header problem.

P.S. David, note that in the comments on the vbr-mp3-fix page, one poster stated that the fix didn't entirely work, but he then converted his mp3 to version 1 format for a solution. This harks back to the earlier discussion in the August 1 post about how mp3 header versions could be a factor in playback performance on the iPod.
moriond at 2007-11-15 17:37:37 >
# 4 Re: Im having trouble going from MP3 to AAC
Thanks for all this, moriond. One further point - it's clear that some files which will play perfectly in iTunes, showing the correct file duration, are much more problematical on the iPod itself. The iPod, it appears, is extremely sensitive to MP3 structure.

Since I essentially build the MP3 files myself when merging in MarkAble, I'm pretty sure by now that I meet the standard. But the iPod, it seems, does not always agree.
david1951 at 2007-11-15 17:38:42 >
# 5 Re: Im having trouble going from MP3 to AAC
Originally posted by david1951
One further point - it's clear that some files which will play perfectly in iTunes, showing the correct file duration, are much more problematical on the iPod itself. The iPod, it appears, is extremely sensitive to MP3 structure.
David,
It may be that in iTunes the CPU runs additional checks that catches these errors even though it uses the same algorithm for reading mp3 header structure. See this speculation extracted from an August 3, 2005 post (http://forums.ipodlounge.com/showthread.php?s=&postid=644518#post644518) considering how there may be differences in the way that iTunes can correct faulty time information that may not applicable to the iPod (covered below) and how inconsistent iTunes Music Library database information may also be handled differently in these situations (later discussion that was not extracted for this quote).

Notice that in the description of the links Robert posted that the erroneous times don't get corrected until playback begins under iTunes.
Originally posted by moriond, extracted from Aug 3, 2005 (http://forums.ipodlounge.com/showthread.php?s=&postid=644518#post644518) post
Two things to consider: First, think about what is different in playing tracks on the iPod vs. in iTunes on your computer. For the iPod you want playback actions to use minimum computation and just play, because anything else eats up battery life and also takes up time that will show up as pauses in playback. So you're going to rely on the information that gets put into the iTunes Music Library.xml database file and/or the information in the header tags as you read in/start playing the track. That's why VBR mp3 files can play correctly in iTunes but may cut off short in playback on the iPod if the header scheme isn't one that the QuickTime encoder/decoder uses -- if the estimate is slightly off playing in iTunes I bet that other checks (such as simply looking at the starting point storage location of the next database entry) or else reading tags at the end of the mp3 file (one of changes that ID3 tag v.2.4 allowed, I think), can easily allow the CPU to recalculate the correct end time. And I bet the time estimate doesn't get updated to the correct value in the iTunes playback display until you actually start playing. You don't do those kind of corrections in the iPod playback.


The extract was from the last post in the thread where jonboy posted his solution (http://forums.ipodlounge.com/showthread.php?s=&postid=638860#post638860) to getting bookmarkable AAC audiobooks to play without lockup problems on a photo iPod after the 2005-06-26 software update. I'm curious to learn whether this method (converting merged mp3 audiobook files with ID3 tags set to none to AAC with iTunes and then making the file bookmarkable via either the MakeBookmarkable AppleScript for Macs, or the .m4a->.m4b rename on PCs) continues to work for color iPods, like your own.

The audiobook lockup issue appears to be fixed for the nano, but I wonder whether other issues tied to mp3 header format such as skipping or shortened play still affect it. This Apple Discussions forum post on Nano's mp3 VBR skipping issue (http://discussions.info.apple.com/webx?50@209.qn3na0OrWFd.1@.68b9db7a) might suggest this is still a problem. YMMV.
moriond at 2007-11-15 17:39:43 >
[an error occurred while processing this directive]
[an error occurred while processing this directive]