Help - Search - Members - Calendar
Full Version: Howto: Ripping and Encoding to Nero Digital Audio AAC in Linux
Hydrogenaudio Forums > Lossy Audio Compression > AAC > AAC - General
psyllium
This article is now available on the Hydrogen Audio Wiki: http://wiki.hydrogenaudio.org/index.php?ti..._Nero_AAC_Guide

Hi all,

Being both an avid Linux user and having an interest in audio compression, I was quite disappointed to find that the performance of faac to create .AAC or .MP4 files is somewhat poor (don't quote me on this, check google wink.gif). On the other hand, I've heard good things about the free Nero Digital Audio AAC encoder. The only problem is I wasn't able to find a Linux version of it.

So I decided to try out the Nero AAC encoder under Wine, using my Ubunto Linux (Dapper 6.06) operating system. To my surprise, it seems to work quite well as a command line tool. What is missing, however, is a graphical user interface.

I've always been a fan of K3b to do any of my burning/ripping/encoding of audio, so I thought I would try and interface the Nero AAC encoder with this. Basically K3b will send a raw stream of audio data to the standard input of a program you specify. We have to make sure that the output from K3b is in the correct format for the Nero AAC encoder. We do this by converting the audio stream to Microsoft .WAV format using SOX.

Recipe requirements:
. Linux (I'm using Ubuntu Dapper Drake 6.06)
. Wine (0.9.9-0ubuntu2 .deb package from Synaptic/apt-get). Wine must be set up and installed - you at least need a 'Windows' and a 'Windows\System32' directory. The encoder itself doesn't require any extra DLLs.
. Sox (12.17.9-1 .deb package from Synaptic/apt-get)
. K3b (0.12.17 compiled from source at http://k3b.plainblack.com/download )
. Nero Digital Audio Reference MPEG-4 & 3GPP Audio Encoder (1.0.0.2 downloaded from http://www.nero.com/nerodigital/eng/Nero_Digital_Audio.html )
. /dev/shm filesystem (this is often installed by default - you can get by without it, but your hard disk will end up doing more work)

Step 1 - Configure Wine
I won't go into too much detail about this here, but it's important that Wine can access all the files on your drive. I usually do this by keeping the default of Z:\ to be the 'root' (i.e. '/') filesystem. The program 'winecfg' is very useful in setting up this.

Step 2 - Install Nero Digital Audio executables
This bit is pretty easy. You just unzip the files to a directory somewhere.
You might want to test out that the executables can run by doing something like:
CODE
$ wine neroAacEnc.exe

in the 'win32' directory of the extracted files.
You should see some output like this:
CODE
err:font:ReadFontDir Can't open directory "/home/chris/.wine/dosdevices/c:/windows/Fonts"
*************************************************************
*                                                           *
*  Nero Digital Audio Reference MPEG-4 & 3GPP Audio Encoder *
*  Copyright (C) 2006 Nero AG                               *
*  All Rights Reserved Worldwide                            *
*                                                           *
*  Package build date: May 26 2006                          *
*                                                           *
*  See -help for a complete list of available parameters.   *
*                                                           *
*************************************************************

ERROR: no input file specified

My Wine isn't set up for GUI stuff for Wine too well yet, hence the error message at the top. We don't have to worry about that though, because this is just a command line application.

Step 3 - Create 'neroaac' wrapper script
So I made a wrapper script around neroAacEnc.exe and neroAacTag.exe. The code for it is below. Copy the code into a file '/usr/local/bin/neroaac'. Make sure you chmod it to something like 755.

CODE
#!/bin/bash
TEMPFILE=/dev/shm/neroaac-$RANDOM
cd /home/chris/winec/nero/win32
sox -x -s -w -t raw -r 44100 -c 2 "$1" -w $TEMPFILE.wav
wine neroAacEnc.exe -if $TEMPFILE.wav -of $TEMPFILE.mp4
wine neroAacTag.exe $TEMPFILE.mp4 -meta:title="$3" -meta:artist="$4" -meta:comment="$5" -meta:track="$6" -meta:album="$7" -meta:year="$8"
mv $TEMPFILE.mp4 "$2"
rm $TEMPFILE.wav


IMPORTANT: Change the line that reads "cd /home/chris/winec/nero/win32" to be the directory where you have neroAacEnc.exe and neroAacTag.exe located.

Just in case you are interested, this program will take in the following parameters:
1: Source filename (or '-' for stdin). The data this script takes in will be RAW 16 bit, 44.1kHz, big endian, stereo to match the format that k3b outputs.
2: Output filename. e.g. "myfile.mp4"
3: Track Title
4: Track Artist
5: Track Comment
6: Track Number
7: Album
8: Year

It's a bit hard to test this script on its own because of the format of the input file. K3b itself doesn't even export RAW audio in this format when you have RAW selected as a format!

Step 4 - Configure K3b to use 'neroaac' as an External Plugin

I'll do this with the aid of some screenshots.

4.1. Load up K3b and start a new Audio CD project:
IPB Image

4.2. Drag an audio file into the project and hit the arrow button in the project with the tooltip 'Convert audio tracks to other audio formats':
IPB Image

4.3. In the Audio Project Conversion box that appears hit the icon that looks like a mechanical gear. You might have to change the Filetype to something like 'Flac' in order to do this:
IPB Image

4.4. In the next dialog box add a new program to the list and enter the following values in the 'Configure Plugin' box:
IPB Image
The command line is:
CODE
neroaac - %f %t %a %c %n %m %y


4.5. Close the 'Configure Plugin' box. Also close the 'Audio Project Conversion' box.

This completes the configuration of K3b. You can now use the 'Convert Audio Project' to convert any files that K3b can read into .MP4 files. Note that if you want all the meta tags (e.g. "Album") set, you will have to open the 'Burn' dialog for the Audio project and enter the CD Text information and then hit the "Save" button.

You will also be able to rip to .MP4 by selecting your CD reader/recorder in the tree and using the left-most button:
IPB Image

Known flaws/limitations:
. The progress bar goes to 100% quickly when converting a file and then sits there for a while. This is because K3b judges the completeness of the operation by how much of the file it has fed to the program. The program needs to take the *whole* file straight up because it needs to make a .WAV file out of it before sending it to neroAacEnc.exe. SOX will not support outputting a WAV file to a data stream.
pepoluan
This will be much better if put in the wiki smile.gif

Can someone do it?
psyllium
QUOTE(pepoluan @ Sep 14 2006, 00:10) *

This will be much better if put in the wiki smile.gif

Can someone do it?


I can do it, but I've created an account on the Wiki but I can't edit. Username: 'psyllium'.
Cosmo
QUOTE(psyllium @ Sep 13 2006, 23:14) *

... I've created an account on the Wiki but I can't edit.


http://wiki.hydrogenaudio.org/index.php?title=Main_Page
QUOTE
Important Note: Due to recent spammer attacks, editing the Hydrogenaudio Wiki pages is reserved for validated users only. Please register with Hydrogenaudio here and send a PM to Jan S. asking for editing access.
psyllium
QUOTE(Cosmo @ Sep 14 2006, 13:45) *

QUOTE(psyllium @ Sep 13 2006, 23:14) *

... I've created an account on the Wiki but I can't edit.


http://wiki.hydrogenaudio.org/index.php?title=Main_Page
QUOTE
Important Note: Due to recent spammer attacks, editing the Hydrogenaudio Wiki pages is reserved for validated users only. Please register with Hydrogenaudio here and send a PM to Jan S. asking for editing access.



Thanks, I've sent Jan a PM smile.gif.
psyllium
I've added this guide to the Wiki now. If anyone wants to fix up any formatting or other stuff, feel free. biggrin.gif

http://wiki.hydrogenaudio.org/index.php?ti..._Nero_AAC_Guide
nutela
QUOTE(psyllium @ Sep 12 2006, 13:01) *



Being both an avid Linux user and having an interest in audio compression, I was quite disappointed to find that the performance of faac to create .AAC or .MP4 files is somewhat poor (don't quote me on this, check google wink.gif). On the other hand, I've heard good things about the free Nero Digital Audio AAC encoder.


Performance? you mean audio quality or cpu time?
psyllium
QUOTE(nutela @ Jan 15 2007, 18:43) *

QUOTE(psyllium @ Sep 12 2006, 13:01) *



Being both an avid Linux user and having an interest in audio compression, I was quite disappointed to find that the performance of faac to create .AAC or .MP4 files is somewhat poor (don't quote me on this, check google wink.gif). On the other hand, I've heard good things about the free Nero Digital Audio AAC encoder.


Performance? you mean audio quality or cpu time?


Audio quality

Edit: I did a quick search on the net and I see that the previous page which I may have based my assumption of was using version 1.17 of FAAC. I notice FAAC is now up to version 1.25 and I'd be interested to know if anyone has any info regarding any improvements in sound quality.
ozmosis82
Since the latest release of Nero Digital includes a Linux version of the encoder & decoder, am I to assume that it's as simple as pointing k3b to the executable and we're off?
psyllium
QUOTE(ozmosis82 @ Aug 31 2007, 18:09) *

Since the latest release of Nero Digital includes a Linux version of the encoder & decoder, am I to assume that it's as simple as pointing k3b to the executable and we're off?


I haven't given that a go yet. You might want to check the wiki entry for the latest instructions which remove the SOX step etc.
imre_herceg
QUOTE(ozmosis82 @ Aug 31 2007, 10:09) *

Since the latest release of Nero Digital includes a Linux version of the encoder & decoder, am I to assume that it's as simple as pointing k3b to the executable and we're off?


I tried, but I couldn't get it to work, I did not know what parameters to use. Moreover, Nero did not release the tagging tool for Linux, so I don't think the present release will make the use of Wine and the Windows binaries superfluous.
oldbat
QUOTE(imre_herceg @ Aug 31 2007, 11:21) *

QUOTE(ozmosis82 @ Aug 31 2007, 10:09) *

Since the latest release of Nero Digital includes a Linux version of the encoder & decoder, am I to assume that it's as simple as pointing k3b to the executable and we're off?


I tried, but I couldn't get it to work, I did not know what parameters to use. Moreover, Nero did not release the tagging tool for Linux, so I don't think the present release will make the use of Wine and the Windows binaries superfluous.


I have set up K3b to rip CDs to .mp4 using PCLinuxOS via the Wine and Nero plugin route and it works fine except that the output files lack the file extension. Consequently, my ipod shuffle fails to recognise the files unless I rename each one, adding the extension manually. This is a rather thankless task. Have I missed something in the instructions? I followed the original forum recipe rather than the wiki.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.