Best he-aac encoder on linux? - encoding

I need an encoder that can convert mp3 files to he-aac (aka aac+).
So far the best one I have found is nero aac encoder .
I have two problemes with it :
- Only one input format : wav . It is a little bit slow to transform mp3 files to wav and then to he-aac.
- a free license for non commercial use.
Too bad ffmpeg does not support he-aac ...
There is a commercial solution, on2 flix, but it seems to be a golden hammer for the simple task I need to do.

Nero AAC is the only one as far as I know. Even if FAAC supported HE-AAC it would be useless, since as an encoder its pretty awfully designed and its quality is not even competitive with LAME, let alone a good AAC encoder.
Kostya on the FFMPEG team is currently working on an AAC encoder but it has a long way to go--its not ready for primetime with LC-AAC, let alone HE-AAC (its not even committed to the repository yet). The first step before anything will be to get the ffmpeg decoder to support HE-AAC; currently it can only be decoded through FAAD.
I don't believe there is any HE-AAC encoder on any platform with a more permissive license than Nero's at this point in time.

I've been using neroAacEnc for quite a while now, and I'm largely satisfied with the results. If you're on Linux, making an .AAC file out of an .MP3 or whatever else, is quite easy, all you need is a small wrapper script, that takes care of decoding into .WAV and after encoding, removes the .WAV file.
Be advised: Converting from one lossy encoding to another further reduces quality. So when you can live with .MP3 and you don't have lossless sources, you better stick to them.
Here's a small script, that converts from .FLACto .AAC, it accepts only .FLAC files as arguments:
#!/bin/zsh
for file in ${argv[*]}; do
flac -d ${file}
neroAacEnc -q 0.6 -if ${file%%.flac}.wav -of ${file%%.flac}.aac
rm ${file%%.flac}.wav
done
This script is sequential, but it can be easily made into a multithreaded script.

There is an encoder called accplus which is under the GNU license available here.

Another encoder: mp4tools

I don't have an idea about the quality, but I just found
enhAacPlusEnc

Related

MP4Box MP4 concatenation not working

I download lectures in mp4 format from Udacity, but they're often broken down into 2-5 minute chunks. I'd like to combine the videos for each lecture into one continuous stream, which I've had success with on Windows using AnyVideo Converter. I'm trying to do the same thing on Ubuntu 15, and most of my web search results suggest MP4Box, whose documentation and all the online examples I can find offer the following syntax:
MP4Box -cat vid1.mp4 -cat vid2.mp4 -cat vid3.mp4 -new combinedfile.mp4
This creates a new file with working audio, but the video doesn't work. When I open with Ubuntu's native video player, I get the error "No valid frames decoded before end of stream." When I open with VLC, I get the error "Codec not supported: VLC could not decode the format 'avc3' (No description for this codec." I've tried using the -keepsys switch, as well, but I get the same results.
All the documentation and online discussion makes it sound as though what I'm trying to do is and should be really simple, but I can't seem to find info relevant to the specific errors I'm getting. What am I missing?
Use the -force-cat option.
For example,
MP4Box -force-cat -add in1.mp4 -cat in2.mp4 -cat in3.mp4 ... -new out.mp4
From the MP4Box documentation:
-force-cat
skips media configuration check when concatenating file.
It looks, by the presence of 'avc3', that these videos are encoded with h.264|avc. There are several modes for the concatenation of such streams. Either the video streams have compatible encoder configurations (frame size, ...) in which case only one configuration description is used in the file (signaled by 'avc1'). If the configurations are not fully compatible, MP4Box uses the 'inband' storage of those configurations (signaled by 'avc3'). The other way would be to use multiple sample description entries (stream configurations) but that is not well supported by players and not yet possible with MP4Box. There is no other way unless you want to reencode your videos. On Ubuntu, you should be able to play 'avc3' streams with the player that goes with MP4Box: MP4Client.

How to programmatically combine .wav files?

I would like to play some kind of text-to-speech with only numbers. I can record 10 wav files, but how can I combine them programmatically ?
For instance, the user types 1234, and the text-to-speech combines 1.wav with 2.wav, 3.wav and 4.wav to produce 1234.wav that plays "one two three four".
1) create a new destination sample buffer (you will want to know the sizes).
2) read the samples (e.g. using AudioFile and ExtAudioFile APIs) and write them in sequence to the buffer. You may want to add silence between the files.
It will help if your files are all the same bit depth (the destination bit depth - 16 should be fine) and sample rate.
Alternatively, if you have fixed, known, sample rates and bit depths for all files, you could just save them as raw sample data and be done in much less time because you could simply append the data as is without writing all the extra audio file reading programs.
The open source project wavtools provides a good reference for this sort of work, if you're ok with perl. Otherwise there is a similar question with some java examples.
The simplist common .wav (RIFF) file format just has a 44 byte header in front of raw PCM samples. So, for these simple types of .wav files, you could just try reading the files as raw bytes, removing the 44 byte header from all but the first file, and concatening the samples. Or just play the concatenated samples directly using the Audio Queue API.

How do I join AAC/.m4a files via CLI (Mac OS X)

I need to quickly join a number of separate m4a files in to one large one. Is there any way to do so via CLI on in Mac OS X?
I think I found a way myself without any transcoding nessesary, with some inspiration from Coxys answer. MP4Box lets me do it: MP4Box -cat file1.m4a -cat file2.m4a output.m4a. It doesn´t retain any metadata but for my purpose its just fine.
Now, given Coxys answer, are there any pitfalls with the file I just haven´t discovered yet?
Unfortunately AAC files cannot be joined by simple concatenation, which is what I assume you mean when you mention doing it via the command line?
If you installed something like ffmpeg then you could certainly build up a process to take in AAC audio files, convert them to the uncompressed wave data, join them all up, then export the resulting file back to AAC again.
Alternately, if using the CLI is not a hard requirement then you could do this with iTunes and Audacity.

Problem of converting caf files using libsnd

I m building a voice recording application in iPhone. The recorded file is transfer to linux server and it need to be converted to wav file.
However, when I try to convert caf file using libsnd, it gives an error.
Error : Not able to open input file testfile.caf
For testing I converted some wave file to caf using libsnd and vice versa.
So I think that there is a problem of my recorded file in iphone.
Anyone has got such an experience ?
I hope can someone help me.
Thanks.
If you use AVAudioRecorder, AudioFile, or any of the other Core Audio APIs, you should be able to record directly to a WAV file, and skip the entire conversion process altogether.
But if you need to convert audio files, first check if the CAF file is a valid file. Does it play? Is the header correct? What is the data format? Is it compressed? Does libsnd support the data format?
(The data format is separate from the file format, which is just a container for various bits of data as well as the sample data. The data format could be PCM, or it could be compressed in any format such as MP3, AAC, uLaw, etc.)

MP3 conversion on Amazon's EC2

I run a small record label and we have a bunch of audio files stored on Amazon's S3. We want them converted to MP3's with a standard bitrate. I read about the NYTimes converting all their PDF's using EC2 and since I'm a nerdy web programmer, I'm intrigued. Instead of downloading all the files and converting them by hand, I'm wondering what it takes to set up an EC2 instance and get it set up to convert files? I want to be able to control it from my web server with PHP, so is the approach to create a virtual LAMP stack and install the LAME encoder?
If you want to convert your audio files (I'm assuming .wav since it's a pretty common format pre-format conversion) to mp3 LAME is a solid encoder.
A full blown LAMP stack is highly unnecessary for using LAME, a simple shell script will suffice.
This will convert all *.wav files in the current directory to .mp3 files if they do not have a converted copy already in-place (LAME doesn't care about clobbering output files).
#!/bin/bash
for file in *.wav; do
dest="${file%wav}mp3"
if [[ -e "$file" ]] && [[ ! -e "$dest" ]]; then
lame "$file" "$dest"
fi
done
You will want to look through man lame for the conversion options specific to your VBR/CBR/ABR (variable, constant and average bitrate) needs.
While the above answer would work if you already had the files in the local EC2, you'll have to fetch each song from S3 into EC2, either into a pipe for conversion or into a temporary file, then either pipe it back up to S3 or store it in a temp file and then send it back to EC2.
Haven't actually used EC2, so not sure what kind of storage you're working with, but you should have plenty of space to store the one temporary mp3.
You would probably also want to create some way of tracking status, probably by doing a listing on your bucket before you start.
Probably a perl script using the S3 module would be more suited, but I'm too lazy to type that all in here :).
You could use Elastic MapReduce for this. Although you'd have to play around a bit to get it to spit out separate files as output.