K3b and Nero AAC: Difference between revisions

From Hydrogenaudio Knowledgebase
m (removed "Wine" from External links)
 
(11 intermediate revisions by 6 users not shown)
Line 1: Line 1:
K3b is a multi-purpose burning/ripping/transcoding tool for Linux under the KDE graphical environment (it can be run under GNOME as well so long as the correct libraries are installed). It is generally pretty stable and does a good job of keeping the meta-data (e.g. title, album, etc) for tracks. The MP4 file format is therefore well matched to be outputted from K3b.
'''K3b''' is a multi-purpose burning/ripping/transcoding tool for Linux under the KDE graphical environment (it can be run under GNOME as well so long as the correct libraries are installed). It is generally pretty stable and does a good job of keeping the meta-data (e.g. title, album, etc) for tracks. The M4A file format is therefore well matched to be outputted from K3b.


=Requirements=
This guide is a modified version of a post on the Hydrogen Audio forum [http://www.hydrogenaudio.org/forums/index.php?showtopic=48228 here].  
* '''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)


=Instructions=
Note that this only allows you to '''create''' .M4A files (that means MP4 audio files) - it does not allow you to decode them so that they can be burnt to a CD. I recommend to rather use the M4A file extension than MP4 because it is more precise.
These instructions assume you have installed all the required items above.


==Configure Wine==
==Requirements==
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.
(In parentheses the versions used by the author)


==Install Nero Digital Audio executables==
* '''Linux''' (I'm using Ubuntu Intrepid Ibex 8.10)
This bit is pretty easy. You just unzip the files to a directory somewhere.<br/>
* '''K3b''' (1.0 or higher. Previous versions do not support the correct byte order or write wave headers.)
You might want to test out that the executables can run by doing something like:<br/>
* '''Nero Digital Audio Reference MPEG-4 & 3GPP Audio Encoder''' (1.3.3.0 or higher required, previous versions don't include a linux neroAacTag executable. It can be downloaded from http://www.nero.com/eng/downloads-nerodigital-nero-aac-codec.php )
<tt>$ wine neroAacEnc.exe</tt><br/>
in the 'win32' directory of the extracted files.<br/>
You should see some output like this:<br/>
<tt>err:font:ReadFontDir Can't open directory "/home/chris/.wine/dosdevices/c:/windows/Fonts"


<nowiki>*************************************************************</nowiki>
==Instructions==
These instructions assume you have installed all the required items above.


<nowiki>*</nowiki>
===Install Nero Digital Audio executables===
This part is pretty easy. You just unzip the files to a directory somewhere. In this instruction we only need the executables in the linux directory. You might want to test out that the executables can run by doing something like:


<nowiki>* Nero Digital Audio Reference MPEG-4 & 3GPP Audio Encoder</nowiki>
  $ ./neroAacEnc


<nowiki>*  Copyright (C) 2006 Nero AG</nowiki>
in the '''linux''' directory of the extracted files. You should see some output like this:


<nowiki>*  All Rights Reserved Worldwide</nowiki>
<code>*************************************************************</code><br>
<code>*                                                            </code><br>
<code>*  Nero AAC Encoder                                          </code><br>
<code>*  Copyright 2008 Nero AG                                    </code><br>
<code>*  All Rights Reserved Worldwide                             </code><br>
<code>*                                                            </code><br>
<code>*  Package build date: Sep 17 2008                          </code><br>
<code>*  Package version:    1.3.3.0                              </code><br>
<code>*                                                            </code><br>
<code>*  See -help for a complete list of available parameters.    </code><br>
<code>*                                                            </code><br>
<code>*************************************************************</code><br>
<br>
<code>ERROR: no input file specified</code>


<nowiki>*</nowiki>


<nowiki>*  Package build date: May 26 2006</nowiki>
===Create 'neroaac' wrapper script===
So I made a wrapper script around neroAacEnc and neroAacTag. 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''.


<nowiki>*</nowiki>
#!/bin/bash
cd /home/chris/nero/linux
./neroAacEnc -if "$1" -of "$2"
./neroAacTag "$2" -meta:title="$3" -meta:artist="$4" -meta:comment="$5" -meta:track="$6" -meta:album="$7" -meta:year="$8"


<nowiki>*  See -help for a complete list of available parameters.</nowiki>
'''IMPORTANT:''' Change the line that reads <code>cd /home/chris/nero/linux</code> to be the directory where you have neroAacEnc and neroAacTag located. You may want to test the wrapper script by just entering <code>neroaac</code> in a terminal window. If everything is correct, you should get an output similar to the one above.


<nowiki>*</nowiki>
Just in case you are interested, this program will take in the following parameters:


<nowiki>*************************************************************</nowiki>
# Source filename (or '-' for stdin).<br />The data this script takes in will be RAW 16 bit, 44.1kHz, little endian, stereo and with a WAVE header. We will make sure k3b outputs the correct format later.
# Output filename. e.g. "myfile.m4a"
# Track Title
# Track Artist
# Track Comment
# Track Number
# Album
# Year


<nowiki>ERROR: no input file specified</nowiki></tt>
===Configure K3b to use 'neroaac' as an External Plugin===


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.
I'll do this with the aid of some screenshots.


==Create 'neroaac' wrapper script==
# Load up K3b and go to the 'Settings' menu and select 'Configure K3b'. Select 'Plugins' and then 'K3b External Audio Encoder'. Hit the 'Configure' button: <br/>[[Image:Settings-configure-k3b.png]]<br/>
# In the next dialog box add a new program to the list and enter the following values in the 'Configure Plugin' box:[[Image:k3b-add-external-plugin.png]]<br/>The command line here is:<br/><code>neroaac - %f %t %a %c %n %m %y</code>
# Ensure you select 'Swap Byte Order' and 'Write Wave Header' so that the neroaac script gets the right format. (Note: I think  k3b has this setting around the wrong way. If k3b was actually outputting little endian, neroaac-enc would work OK. Swapping the byte order seems to fix it.)
# Close the 'Configure Plugin' and 'Options' boxes.


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.
==Usage==
You can now use the 'Convert Audio Project' to convert any files that K3b can read into .M4A files. This is the 'arrow' button in the screenshot below:


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


'''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.
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.


Just in case you are interested, this program will take in the following parameters:
You will also be able to rip to .M4A by selecting your CD reader/recorder in the tree and using the following button:


# 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.
[[Image:K3b-ripping.png]]
# Output filename. e.g. "myfile.mp4"
# Track Title
# Track Artist
# Track Comment
# Track Number
# Album
# 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!


==Configure K3b to use 'neroaac' as an External Plugin==
==Known flaws/limitations==


I'll do this with the aid of some screenshots.
* The progress bar goes to 100% before tagging (so it takes a little bit more to really complete the work). This is because K3b judges the completeness of the operation by how much of the file it has fed to the program.
* Does not support decoding of M4A files. This would require the development of a proper Audio Decoding plugin for K3b.
* Note the remark above to get complete meta tags.


# Load up K3b and start a new Audio CD project:<br/>http://img223.imageshack.us/img223/6554/k3b2bs0.png
==See also==
# 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':<br/>http://img80.imageshack.us/img80/6590/k3b3ox5.png
* [[AAC]]
# 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:<br/>http://img90.imageshack.us/img90/9279/k3b4hh0.png
* [[Ubuntu]]
# In the next dialog box add a new program to the list and enter the following values in the 'Configure Plugin' box:<br/>http://img243.imageshack.us/img243/6195/k3b6dm1.png<br/>The command line here is:<br/><tt>neroaac - %f %t %a %c %n %m %y</tt>
* [[Linux]]
# Close the 'Configure Plugin' box. Also close the 'Audio Project Conversion' box.
* [[KDE]]
* [[Gnome]]


=Usage=
==Notes and references==
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:<br/>
http://img213.imageshack.us/img213/5307/rippingxj3.png


=Known flaws/limitations:=
==External links==
* 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.
* [http://www.hydrogenaudio.org/forums/index.php?showtopic=48228 HA topic]
* [http://www.k3b.org/ K3b]
* [http://www.ubuntu.com/ Ubuntu]
* [http://www.kde.org/ KDE]
* [http://www.gnome.org/ Gnome]


[[Category:Guides]]
[[Category:Guides]]

Latest revision as of 11:12, 5 February 2009

K3b is a multi-purpose burning/ripping/transcoding tool for Linux under the KDE graphical environment (it can be run under GNOME as well so long as the correct libraries are installed). It is generally pretty stable and does a good job of keeping the meta-data (e.g. title, album, etc) for tracks. The M4A file format is therefore well matched to be outputted from K3b.

This guide is a modified version of a post on the Hydrogen Audio forum here.

Note that this only allows you to create .M4A files (that means MP4 audio files) - it does not allow you to decode them so that they can be burnt to a CD. I recommend to rather use the M4A file extension than MP4 because it is more precise.

Requirements

(In parentheses the versions used by the author)

  • Linux (I'm using Ubuntu Intrepid Ibex 8.10)
  • K3b (1.0 or higher. Previous versions do not support the correct byte order or write wave headers.)
  • Nero Digital Audio Reference MPEG-4 & 3GPP Audio Encoder (1.3.3.0 or higher required, previous versions don't include a linux neroAacTag executable. It can be downloaded from http://www.nero.com/eng/downloads-nerodigital-nero-aac-codec.php )

Instructions

These instructions assume you have installed all the required items above.

Install Nero Digital Audio executables

This part is pretty easy. You just unzip the files to a directory somewhere. In this instruction we only need the executables in the linux directory. You might want to test out that the executables can run by doing something like:

$ ./neroAacEnc

in the linux directory of the extracted files. You should see some output like this:

*************************************************************
*
* Nero AAC Encoder
* Copyright 2008 Nero AG
* All Rights Reserved Worldwide
*
* Package build date: Sep 17 2008
* Package version: 1.3.3.0
*
* See -help for a complete list of available parameters.
*
*************************************************************

ERROR: no input file specified


Create 'neroaac' wrapper script

So I made a wrapper script around neroAacEnc and neroAacTag. 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.

#!/bin/bash
cd /home/chris/nero/linux
./neroAacEnc -if "$1" -of "$2"
./neroAacTag "$2" -meta:title="$3" -meta:artist="$4" -meta:comment="$5" -meta:track="$6" -meta:album="$7" -meta:year="$8"

IMPORTANT: Change the line that reads cd /home/chris/nero/linux to be the directory where you have neroAacEnc and neroAacTag located. You may want to test the wrapper script by just entering neroaac in a terminal window. If everything is correct, you should get an output similar to the one above.

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, little endian, stereo and with a WAVE header. We will make sure k3b outputs the correct format later.
  2. Output filename. e.g. "myfile.m4a"
  3. Track Title
  4. Track Artist
  5. Track Comment
  6. Track Number
  7. Album
  8. Year

Configure K3b to use 'neroaac' as an External Plugin

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

  1. Load up K3b and go to the 'Settings' menu and select 'Configure K3b'. Select 'Plugins' and then 'K3b External Audio Encoder'. Hit the 'Configure' button:

  2. In the next dialog box add a new program to the list and enter the following values in the 'Configure Plugin' box:
    The command line here is:
    neroaac - %f %t %a %c %n %m %y
  3. Ensure you select 'Swap Byte Order' and 'Write Wave Header' so that the neroaac script gets the right format. (Note: I think k3b has this setting around the wrong way. If k3b was actually outputting little endian, neroaac-enc would work OK. Swapping the byte order seems to fix it.)
  4. Close the 'Configure Plugin' and 'Options' boxes.

Usage

You can now use the 'Convert Audio Project' to convert any files that K3b can read into .M4A files. This is the 'arrow' button in the screenshot below:

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 .M4A by selecting your CD reader/recorder in the tree and using the following button:

Known flaws/limitations

  • The progress bar goes to 100% before tagging (so it takes a little bit more to really complete the work). This is because K3b judges the completeness of the operation by how much of the file it has fed to the program.
  • Does not support decoding of M4A files. This would require the development of a proper Audio Decoding plugin for K3b.
  • Note the remark above to get complete meta tags.

See also

Notes and references

External links