Guide to iTunes-compatible Nero-encoded AAC |
![]() ![]() |
Guide to iTunes-compatible Nero-encoded AAC |
Oct 25 2003, 11:31
Post
#1
|
|
|
Group: Members Posts: 115 Joined: 4-May 03 Member No.: 6377 |
NOTE MENNO'S WARNING: "This method completely removes the possibility to gapless playback in Nero and other FAAD2 based players." This process should be used as a temporary solution until Apple fixes their player, as Nero's original aac/mp4 files will work with future versions of iTunes while retaining the gapless info that is lost in the mp4->aac->mp4 conversion.
Brief intro: When iTunes came out, I tried out all my AAC/MP4 files to test the compatibility of tags. As annoying as it was to see the files not show any information, at least they played. Then I learned that they could be renamed to .m4a instead of .mp4 and the tags were supposed to work, but this just stopped them from playing completely. So here's how I make Nero-encoded AAC files (using "Transparent" settings, which is the VBR Normal::High quality) that are not only properly tagged, but properly understood by iTunes. PLEASE READ THE ENTIRE GUIDE BEFORE DOING ANYTHING WITH IT Tools necessary:
QUOTE %artist% - %album%\$num(%tracknumber%,2) - %title% You don't need the folders to be called artist - album, but be sure that it is just one directory per album, not artist\album\etc...First, set up the foobar2000 CLI encoder command line as follows (remember to change the locations of encoders to fit your system configuration, though): QUOTE Encoder: c:\windows\system32\cmd.exe Extension: tmp Parameters: /c c:\aacmp4\nencode.exe %s %d && c:\frontend\mp4creator60 -aac-profile=4 -extract=1 %d %d.aac && c:\frontend\mp4creator60 -aac-profile=4 -optimize -create=%d.aac %d.m4a && ~tg %d.m4a --artist "%artist%" --album "%album%" --title "%title%" --track %tracknumber% --genre "%genre%" --year %date% Highest BPS supported: 16 Tag: None I'll explain what this does. It opens a command prompt and tells nencode to encode the files (by the way, be sure to run nencode.exe by itself first to set your encoding preferences. This only has to be done once). Then, because iTunes can't properly interpret Nero's MP4 wrapper, we use mp4creator to extract the aac file from the MP4, then mp4creator rewraps it in its own MP4 container. Finally, tg.exe tags the files based on the tags. Note, that this should leave you with three files per song: song.tmp (the original nero encoded MP4), song.tmp.aac (the AAC file extracted from song.tmp) and song.tmp.m4a (the final file). To eliminate these files, open notepad and copy and paste the following (remembering to rename ~sweep if you didn't put a tilde before yours): QUOTE del /S /Q *.tmp del /S /Q *.aac ~sweep ren *.tmp.m4a *. ~sweep ren *.tmp *.m4a Save the file as del_temp.bat, and put it in the root of your directory with the songs. It will then parse every subdirectory, delete the temp files and rename the final file to song.m4a, which is what iTunes understands. -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ Here's the part I worked hardest on. I wanted a way to have tg.exe automatically add the total number of tracks per each album. The way I've accomplished this task is to use an automatic script execution program called AutoIt v2.64. This is how it works: First, it opens a command prompt in the main directory of your AAC/MP4 files (where it should see a bunch of subdirectories with all the songs), and saves a list of the folders. Then, for each subdirectory, it lists the files with the most recently created file showing at the top and reads the first two characters (the tracknumber) of the latest created song. It then applies the total track value to every song. It might make more sense once you've installed the program and looked at my source code. Here's the code (commented for clarity), which you should save as <whatever>.aut in the main directory of your AAC/MP4's. QUOTE ;Note that you must use double backslashes instead of single backslashes. ;Opens a command line prompt run, cmd.exe Sleep, 1000 send, dir /ad /b > dir.txt{ENTER} send, exit{ENTER} ; Keeps track of the current folder that the script is parsing. Right now, it reads line 1 for the folder name. ; Note that it updates to read the next folder later with the EnvAdd command SetEnv, line, 1 Tag: FileReadLine, curr_dir, dir.txt, %line% IfEqual, ERRORLEVEL, 1, goto, end run, cmd.exe send, cd %curr_dir%{ENTER} ; Here, it lists the files in reverse alphabetic order and retrieves the first two characters, consequently the tracknumber of the final track. Note that you have to change "*.m4a" to "*.mp4" below if you're using that extension. send, dir *.m4a /b /O-N > "filelist.txt"{ENTER} FileReadLine, last_file, %curr_dir%\\filelist.txt, 1 StringLeft, track, last_file, 2 send, ~tg *.m4a --total %track%{ENTER} send, exit{ENTER} FileDelete, %curr_dir%\\filelist.txt EnvAdd, line, 1 goto, Tag End: FileDelete, dir.txt Exit After you've saved the file and you've installed AutoIt, you should be able to double-click the .aut file and it should do it's business. Be sure not to hit the keyboard or do anything else with your computer while it's working. Now just add your files to iTunes and check to make sure all the info (including final track numer) are there when you right-click on the files and go to "Get Info." If you have any problems, please post them and I will try to clarify this guide. Sorry if it's less than coherent, as I'm finishing it up at 5:24am and I haven't gotten to sleep yet This post has been edited by CyberInferno: Nov 7 2003, 11:37 -------------------- -CyberInferno
|
|
|
|
Oct 25 2003, 11:40
Post
#2
|
|
![]() Nero MPEG4 developer Group: Developer (Donating) Posts: 1187 Joined: 11-October 01 From: LA Member No.: 267 |
Please add some info that this method completely removes the possibility to gapless playback in Nero and other FAAD2 based players.
If that is worth anything people should just wait until Apple releases a fixed version of iTunes. Menno |
|
|
|
Oct 25 2003, 15:50
Post
#3
|
|
|
Group: Members Posts: 22 Joined: 12-September 03 Member No.: 8813 |
I've been using the above method, only I've also been using Foobar to extract/rewrap the mp4 file.
Anyway, the upshot is that they work fine when renamed to .m4a but I discovered today that album art cannot be added to the file, even though iTunes can edit the other tags written by tg.exe. i.e A tag change I made in iTunes was picked up by Foobar. |
|
|
|
Oct 25 2003, 23:44
Post
#4
|
|
|
Group: Members Posts: 115 Joined: 4-May 03 Member No.: 6377 |
QUOTE (menno @ Oct 25 2003, 02:40 AM) Please add some info that this method completely removes the possibility to gapless playback in Nero and other FAAD2 based players. If that is worth anything people should just wait until Apple releases a fixed version of iTunes. Menno Menno, is that a flaw of mp4creator? If so, would using the foobar2000 plug-in that converts .mp4->aac and .aac->.mp4 tool written by Case be better? This post has been edited by CyberInferno: Oct 25 2003, 23:45 -------------------- -CyberInferno
|
|
|
|
Oct 26 2003, 00:00
Post
#5
|
|
|
Group: Members Posts: 115 Joined: 4-May 03 Member No.: 6377 |
QUOTE (Muddy Mudskipper @ Oct 25 2003, 06:50 AM) I've been using the above method, only I've also been using Foobar to extract/rewrap the mp4 file. Anyway, the upshot is that they work fine when renamed to .m4a but I discovered today that album art cannot be added to the file, even though iTunes can edit the other tags written by tg.exe. i.e A tag change I made in iTunes was picked up by Foobar. I've also noticed that album art doesn't work. Have you tried using the AutoIt script for automatically adding the total track number (I'm hoping that I commented it well enough and wrote it well enough so that it's fairly versatile)? -------------------- -CyberInferno
|
|
|
|
Oct 26 2003, 00:15
Post
#6
|
|
![]() Nero MPEG4 developer Group: Developer (Donating) Posts: 1187 Joined: 11-October 01 From: LA Member No.: 267 |
QUOTE (CyberInferno @ Oct 25 2003, 11:44 PM) QUOTE (menno @ Oct 25 2003, 02:40 AM) Please add some info that this method completely removes the possibility to gapless playback in Nero and other FAAD2 based players. If that is worth anything people should just wait until Apple releases a fixed version of iTunes. Menno Menno, is that a flaw of mp4creator? If so, would using the foobar2000 plug-in that converts .mp4->aac and .aac->.mp4 tool written by Case be better? No it's not a flaw. There is just no way to store the gapless info in the .AAC, hence the gapless info is lost when converting mp4 -> aac -> mp4 Menno |
|
|
|
Oct 26 2003, 06:34
Post
#7
|
|
|
Group: Members Posts: 391 Joined: 24-December 02 From: Eugene, OR Member No.: 4224 |
So, does anyone know if iTunes is working on the compatibility from thier end? They did say they were aware of the problem, but do they even care?
-------------------- http://www.pkulak.com
|
|
|
|
Oct 26 2003, 08:12
Post
#8
|
|
|
Group: Members Posts: 115 Joined: 4-May 03 Member No.: 6377 |
QUOTE (menno @ Oct 25 2003, 03:15 PM) No it's not a flaw. There is just no way to store the gapless info in the .AAC, hence the gapless info is lost when converting mp4 -> aac -> mp4 Menno So neither Case's aac -> mp4 plugin nor mp4creator are equiped with gapless capability? Do iTunes encoded songs have the same gapless attributes? -------------------- -CyberInferno
|
|
|
|
Oct 26 2003, 09:17
Post
#9
|
|
![]() Group: Developer Posts: 2797 Joined: 22-September 01 Member No.: 6 |
QUOTE (CyberInferno @ Oct 26 2003, 10:12 AM) So neither Case's aac -> mp4 plugin nor mp4creator are equiped with gapless capability? Do iTunes encoded songs have the same gapless attributes? No other encoder besides Nero and FAAC add gapless info to MP4, and FAAD2 is currently the only decoder which can use it. -------------------- Juha Laaksonheimo
|
|
|
|
Oct 26 2003, 09:27
Post
#10
|
|
|
Group: Members Posts: 2478 Joined: 2-September 02 Member No.: 3264 |
With the latest foobar acting as a front end during encoding, my Nero encoded files finally play correctly. Any idea why this happened in the first place?
|
|
|
|
Oct 26 2003, 10:57
Post
#11
|
|
![]() Nero MPEG4 developer Group: Developer (Donating) Posts: 1187 Joined: 11-October 01 From: LA Member No.: 267 |
QUOTE (torok @ Oct 26 2003, 06:34 AM) So, does anyone know if iTunes is working on the compatibility from thier end? They did say they were aware of the problem, but do they even care? yes |
|
|
|
Oct 26 2003, 10:59
Post
#12
|
|
![]() Nero MPEG4 developer Group: Developer (Donating) Posts: 1187 Joined: 11-October 01 From: LA Member No.: 267 |
QUOTE (CyberInferno @ Oct 26 2003, 08:12 AM) QUOTE (menno @ Oct 25 2003, 03:15 PM) No it's not a flaw. There is just no way to store the gapless info in the .AAC, hence the gapless info is lost when converting mp4 -> aac -> mp4 Menno So neither Case's aac -> mp4 plugin nor mp4creator are equiped with gapless capability? Do iTunes encoded songs have the same gapless attributes? The gapless info is completely inside the mp4 container and has nothing to do with the aac data. So if you remove the aac from the mp4 file the gapless data is lost. No way to get it back when converting the aac back to mp4. iTunes encoded songs do not have those attributes. Menno |
|
|
|
Oct 26 2003, 11:01
Post
#13
|
|
![]() Nero MPEG4 developer Group: Developer (Donating) Posts: 1187 Joined: 11-October 01 From: LA Member No.: 267 |
QUOTE (JohnV @ Oct 26 2003, 09:17 AM) FAAD2 is currently the only decoder which can use it. FAAD2 does not handle the gapless data. The frontend using the mp4 file reading library is responsible for that. Again, the gapless info has nothing to do with AAC only with the MP4 container. Menno |
|
|
|
Oct 30 2003, 03:12
Post
#14
|
|
|
Group: Members Posts: 391 Joined: 24-December 02 From: Eugene, OR Member No.: 4224 |
When I try to use mp4encode60.exe like that it whines about me changing the format, once for each conversion, and then when I'm done I have a file that's twice the size and still won't play in iTunes.
-------------------- http://www.pkulak.com
|
|
|
|
Nov 1 2003, 18:38
Post
#15
|
|
|
Group: Members Posts: 351 Joined: 27-December 02 From: Norway Member No.: 4258 |
Is there a way to do this, without having to re-encode the files again? (i've already done that with Nero-AAC) ? I just want to convert it from .mp4 to .m4a (or whatever works with iTunes) - not re-encode with NeroAAC again (i guess that's like transcoding, you get even worse quality).
-------------------- myspace.com/borgei - last.fm/user/borgei
|
|
|
|
Nov 5 2003, 06:30
Post
#16
|
|
![]() Group: Members Posts: 97 Joined: 19-September 03 From: BKK, Thailand Member No.: 8916 |
|
|
|
|
Nov 7 2003, 10:50
Post
#17
|
|
|
Group: Members Posts: 115 Joined: 4-May 03 Member No.: 6377 |
I updated my code in the initial post for the automatic total track tags to eliminate some problems (it wouldn't work if you had files other than the .m4a files in the directory before). I also noticed that specifying a root directory was [u]not[/] necessary, so I removed the references to it. Please update your tg.aut (or whatever you called it) with the new code.
EDIT: Also created guide modifications using Case's foobar2000 plugin if the user chooses to do so. This post has been edited by CyberInferno: Nov 7 2003, 11:33 -------------------- -CyberInferno
|
|
|
|
Nov 7 2003, 11:30
Post
#18
|
|
|
Group: Members Posts: 115 Joined: 4-May 03 Member No.: 6377 |
As some others have mentioned, you can use Case's .mp4->.aac->.mp4 tool instead of mp4tools if you wish. Here are the modifications that need to be made to the guide in order for you to do so (main changes highlighted in red) (remembering to simply ignore all references to mp4tools):
foobar2000 CLI encoder options: QUOTE Encoder: c:\windows\system32\cmd.exe Extension: mp4 Parameters: /c c:\aacmp4\nencode.exe %s %d && ~tg %d --artist "%artist%" --album "%album%" --title "%title%" --track %tracknumber% --genre "%genre%" --year %date% Highest BPS supported: 16 Tag: None After encoding, add the files to foobar2000 and select them, then right-click and select "Extract AAC Track" At this point you should delete the .mp4 files that you no longer need. You can either save the following in a batch file, or type it in the command prompt (running it from the root directory of your music as always): QUOTE ~sweep del *.mp4 Now, add all the new .aac files into foobar2000, select them, right-click on them and select "Convert to MP4." At this point you should once again either make a batch file with the following or type the lines manually:QUOTE ~sweep del *.aac ~sweep ren *.mp4 *.m4a You can then use my automatic tagging script if you'd like to add the total tracks tag to your files. -------------------- -CyberInferno
|
|
|
|
Dec 19 2003, 00:49
Post
#19
|
|
|
Group: Members Posts: 47 Joined: 12-June 02 From: Mauritius Member No.: 2281 |
Download iTunes 4.2.
All M4A files generated by foobar mp4 plugin (leveraging Nero 6.3) work fine in 4.2. This post has been edited by costello: Dec 19 2003, 00:50 |
|
|
|
Dec 19 2003, 01:08
Post
#20
|
|
|
Group: Members Posts: 78 Joined: 4-May 03 Member No.: 6374 |
QUOTE (costello @ Dec 18 2003, 03:49 PM) Download iTunes 4.2. All M4A files generated by foobar mp4 plugin (leveraging Nero 6.3) work fine in 4.2. I can confirm that m4a generated by foobar2000 with faac are also now read properly by this new iTunes. |
|
|
|
Dec 19 2003, 01:28
Post
#21
|
|
|
Group: Members Posts: 115 Joined: 4-May 03 Member No.: 6377 |
QUOTE (costello @ Dec 18 2003, 03:49 PM) Download iTunes 4.2. All M4A files generated by foobar mp4 plugin (leveraging Nero 6.3) work fine in 4.2. Awesome. I was in the process of downloading the update when I read your post. I'm glad to see they've fixed iTunes. It would figure that I can't find an actual changelog. I hope a moderator will officially close this thread and take it off the important topics list (although I enjoyed having an important thread EDIT: Another bug fixed: Previously, album art could not be added to aac/mp4 files that were tagged by foobar. This has now been fixed. This post has been edited by CyberInferno: Dec 19 2003, 01:57 -------------------- -CyberInferno
|
|
|
|
May 5 2004, 17:20
Post
#22
|
|
|
Group: Members Posts: 61 Joined: 27-October 01 Member No.: 362 |
Forgive me if this has been covered, I tried to search with no luck. Is there some way to adapt this to work with EAC. I used the command line options but wind up with the temp filename with m4a extention and no tags. I cannot for the life of the find foo_mp4 anywhere. Everylink is dead. Thanks.
|
|
|
|
May 5 2004, 18:08
Post
#23
|
|
|
Group: Members Posts: 9 Joined: 5-May 04 Member No.: 13900 |
|
|
|
|
May 6 2004, 20:21
Post
#24
|
|
|
Group: Members Posts: 61 Joined: 27-October 01 Member No.: 362 |
I am VERY confused with all of this. Is there any sort of step-by-step clear-cut simple and descriptive howto on this? You know, for someone that is totally and completely lost in every way with foobar. Honestly, I must be a freaking moron because I can't seem to understand a single thing about this program at all.
Where do the tags come from? They don't make it to my M4A files. Is there a way to just re-wrap the MP4 files only? I have tried my best to take out the nencode part and get nothing but errors like "Encoding failed". I know that it's is me that is the problem here and not foobar, total user error of the highest order. My dream is to be able to use EAC to rip my CDs, have them encoded by nero, and play them on my iPod. Is this an impossible dream? |
|
|
|
May 6 2004, 20:38
Post
#25
|
|
|
Group: Members Posts: 61 Joined: 27-October 01 Member No.: 362 |
Someone throw me a line and tell me if I am coming close to what is going on.
foobar takes the source file, in this case a WAV, copies it to a temporary file, whatever.fb2k.tmp.wav nencode takes the fb2k.tmp.wav file and encodes it to whatever.TMP mp4creator takes the TMP file and extracts the AAC as whatever.AAC mp4creator takes the AAC file and re-wraps is at whatever.M4A Is that right? I still don't understand the tagging part though, please help a hopeless foobar dummy. |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 22nd November 2009 - 07:56 |