AAC Codec Library (libFAAC alternative) - audio

I'm looking for an AAC encoder/decoder library that works on Linux and Windows (for a C\C++ app). This is for a commercial product, so libFAAC is not an option. I've looked at the one from Nero and MainConcept, but I'd prefer something with a LGPL license or the like that doesn't require license fees.

You may want to consider android's stagefright, though it will probably take some work to adapt to a general purpose library. It available is under the Apache 2.0 license https://android.googlesource.com/platform/frameworks/base/+/froyo-release/media/libstagefright/codecs
The 3GPP 26.410 AAC reference code is very high quality for reference code though they don't mention any specific licensing terms in their package http://www.3gpp.org/ftp/Specs/html-info/26410.htm
FFmpeg has a very fast LGPL AAC decoder and an experimental LGPL AAC encoder. The decoder is great but the encoder really sucks. http://git.ffmpeg.org/?p=ffmpeg;a=tree;f=libavcodec

FAAD2 is great AAC decoder: http://www.audiocoding.com/faad2.html
On the encoder side of things - no good LGPL implementation is available, you'd have to go with commercial encoders.

Related

Does ReplayGain work on Opus audio files, too, and how do I apply it?

ReplayGain is a proposed technical standard published by David Robinson in 2001 to measure and normalize the perceived loudness of audio in computer audio formats such as MP3 and Ogg Vorbis.
Does ReplayGain work on audio files encoded with Opus, too? And what's a command-line solution to apply it?

Is there a specification for AAC-LC (de)compression?

Is there a specification that describe specifically the AAC-LC standard, and is it a realist goal to achieve a codec, not a general one, but for a specific AAC-LC format, with predefined number of channels and sample rate?
Are there some existing projects for AAC-LC specifically?
[EDIT]
I found a first project, coded with MatLab, that is looking promising:
http://www.mathworks.com/matlabcentral/fileexchange/28028-mpeg-4-aac-lc-decoder
It directly demux mp4, and decode AAC-LC with no blah-blah. Thousand of hardcoded values and box definitions. Maybe this is exactly built to test common iPhone/Windows Phone MP4s.
AAC (Advanced Audio Coding), including the LC (Low Complexity) profile, was originally specified in ISO/IEC 13818-7 (MPEG-2 Part 7). It was later updated by ISO/IEC 14496-3 (MPEG-4 Part 3); subpart 4 covers AAC specifically, and subpart 1 (Main) is likely to also be helpful.
General information can be found on the Wikipedia page.
There are a few existing open source implementations. Currently one of the better quality ones is the Fraunhofer FDK AAC Codec Library for Android; it was released as open source as part of Android but is not Android-specific. Its primary disadvantage is that its license is considered to be incompatible with the GPL. Some other open source implementations are listed in FFmpeg's AAC Encoding Guide, including FFmpeg's native AAC encoder, which is in development.

Does MPMoviePlayerController support AVI format in iOS?

I'm able to play .mp4, .m4v formats using MPMoviePlayerController, but its not playing .avi format. MPMoviePlayerController internally would use QuickTimePlayer and this QuicktimePlayer would support AVI format, then y not MPMoviePLayerController API?
Thank You,
Suse
AVI is a container format. It can contain many different audio/video formats internally, most of which iOS does not support natively.
You may be able to decode the contents of your .AVI using the ffmpeg library. Note, however, that decoding video using ffmpeg will drain the battery considerably faster than normal, as it cannot take advantage of the hardware acceleration that MPEG4 decoding uses, and using ffmpeg may subject your application to software licensing complications (as ffmpeg is licensed under LGPL, with some GPL and non-free components).

How to develop an AAC converter for Linux?

I am a beginner developer want to develop a MP3 to AAC converter for Linux. But I don't know how to start as I havn't done any development in Linux before. I am using Ubuntu 10.04. Can anyone tell me how to start and from where? What libraries do I need?
Thanks
If you want to use an encoder, FAAC is open source, so you could write a program that uses it. Or check out the source code.
I.A.N.A.L. but, AAC is a patented technology, so you may have to pay fees to make a commercial project.
A good place to start learning how lots of Unix programs are written, is using the GNU toolchain, GCC, Make, Configure etc...
The ffmpeg libraries are a great swiss army knife for anything dealing with audio/video. In fact, you can use the ffmpeg command-line interface to easily convert between MP3 and AAC:
ffmpeg -i <path to MP3 file> <path to AAC file>
This requires that ffmpeg be compiled with FAAC and LAME support. I don't think Ubuntu's ffmpeg libraries include these by default for legal reasons, but there are ways to install MP3 and AAC enabled versions: http://gebaar.blogspot.com/2009/06/howto-easily-enable-mp3-mpeg4-aac-and.html
If you want to use ffmpeg's underlying libraries (libavcodec, libavformat, etc) to code it yourself: http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/api-example_8c-source.html

Transcoding audio and video

What is the best way to transcode audio and video to show on the web?
I need to do it programmatically. I'd like to do something like YouTube or Google Video where users can upload whatever format they want, and I encode it to flv, mp3, and/or mp4. I could do it on our server, but I would rather use an EC2 instance or even a web service. We have a Windows 2008 server.
I strongly recommend ffmpeg. On Windows, I have found this site to host good binaries.
kind of depends on how much you want to spend. if this is a brand new (and mostly unfunded) idea, then go the ffmpeg route, but as you scale and look to iprove the quality, consider one of the more professional encoding tools that can be automated (Rhozet, Inlet, Digital Rapids are 3 options).
ffmpeg can do it, its a command-line tool that uses the libavcodec. Can handle conversion of most video formats. Its license is LPGL, if that suits your needs. You can utilize it as a separate process programmatically, or if you're feeling hardcore, you can use the libavcodec library yourself to encode directly.
When you want to transcode to Flv (which is probably the best for the web) then I use this line:
ffmpeg -hq -y -i $directory/$file -r 20 -s 300x200 -deinterlace -ar 22050 $directory/$file.flv 1>/dev/null 2>/dev/null
It works very well, under linux of course :-).
If you are looking for GPL'ed stuff:
For audio mucking about, try sox. Very powerful! It does a lot! It's included in most linux distributions.
There is also the famous LAME for mp3 [audio] encoding.
For video, mencoder is impressive! It's part of the mplayer package. It will handle conversions from most video formats. Far more than I ever dreamed existed. (For documentation, see Chapter 9. Basic usage of MEncoder and Chapter 10. Encoding with MEncoder.)
It's somewhat more limited about what it can create. But it does support mpeg4, mpeg2, dvd-mpeg, flv, and many others. (While I haven't tried flv myself, google shows other folks are using it.)
I have done things like jpeg + sound -> mpeg4 movie:
nice +20 $MENCODER mf://${JPEGFILE} -mf w=720:h=480:fps=1/${SOUNDLENGTH}:type=jpeg -audiofile ${SOUNDFILE} -ovc lavc -oac lavc -lavcopts vcodec=mpeg4 -ofps 30000/1001 -o ${MENU_MPG}
Or transcode arbitrarily formated video to dvd-compatible mpeg:
nice +20 $MENCODER -edl ${EDL} -ovc lavc -oac lavc -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=${VBITRATE}:keyint=18:acodec=ac3:abitrate=192:aspect=4/3:trell:mbd=2:dia=4:cmp=3:precmp=3:ildctcmp=3:subcmp=3:mbcmp=3:cbp:mv0:dc=10 -of mpeg -mpegopts format=dvd -vf scale=720:480,harddup -srate 48000 -af lavcresample=48000 -ofps 30000/1001 -o ./${INFILE}.reformatted ${FILEPATH}
-edl/-edlout [Edit Decision Lists] are used to snip out just the video sections I want.
${VBITRATE} is normally 5000 for DVD-mpeg-video. But if you flub it a bit you can squeeze more video onto a dvd. Assuming you can tolerate the artifacts.
scale=720:480,harddup -- Little issue with the scale being wrong for my dvdplayer, and harddup to resolve a sound-video desync issue on my "el cheapo" player.
(To playback on a widescreen player that wouldn't handle 4x3 video, I've used atrocities like "aspect=16/9", "-vf scale=560:480,expand=720:480,harddup". But in general you don't want to waste bits encoding black-bars.)
This is not the most efficient set of options to mencoder by far! It can be time consuming to run. But I had other goals in mind...
Do be aware that certain parts of ffmpeg are under GPL. I believe the libpostproc module is and if I recall correctly this is used in transcoding. Make sure this license is compatible with what you're doing.
I would take a look at Main Concept's Reference SDK:
http://www.mainconcept.com/site/developer-products-6/pc-based-sdks-20974/reference-sdk-21221/information-21243.html
It is built for transcoding and, since it is a licensed SDK it doesn't have any of the legal issues surrounding ffmpeg/libavcodec.
Rhozet Carbon Coder can handle a wide range of formats plus you can use plugins to alter the video (eg add a watermark)

Resources