HOWTO:
Follow steps below to patch FFMPEG that enables aac+ encoding.
You have to install libaacplus first!
Here is newer-patch code for debian/ubuntu linux:
$ svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg -r 23548
$ wget http://tipok.org.ua/downloads/media/aac+/libaacplus-simple-sample/ffmpeg...
$ patch -p1 < ffmpeg-aacp.09062010.diff
$ ./configure --enable-libaacplus
$ make
# make install
Here is old-patch code for debian/ubuntu linux:
$ wget -O ffmpeg.tar.gz "http://git.ffmpeg.org/?p=ffmpeg;a=snapshot;h=124fefe867ef023a89ca4f4cc76e700342286b0d;sf=tgz"
$ tar -xvzf ffmpeg.tar.gz
$ cd ffmpeg
$ wget -O libswscale.tar.gz "http://git.ffmpeg.org/?p=libswscale;a=snapshot;h=1842e7d1cc122feea92dcd2d9a9a1adfb397aa24;sf=tgz"
$ tar -xvzf libswscale.tar.gz
$ wget http://tipok.org.ua/downloads/media/aac+/libaacplus-simple-sample/ffmpeg...
$ patch -p1 < ffmpeg-aacp.diff
$ ./configure --enable-libaacplus
$ make
# make install
CHANGELOG:
14.04.2009:
- Stereo encoding bug fixed (encoded sound quality is much better)
- Mono encoding implemented.
- Audio specific config bits changed (now flash player can play aac+ "m4a" files, produced by ffmpeg)
- Patch updated for latest FFmpeg
ENCODED SAMPLES:
sample32.aac
sample32.mp4
sample64.aac
sample64.mp4
source.mp2 (not aac+ encoded) - source file

Hello tipok I appreciate your
Hello tipok
I appreciate your work so much.
I followed your instruction all the way but I get Unknown codec 'libaacplus'
My ffmpeg is like this.
FFmpeg version 0.5.1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/usr/local --disable-debug --enable-shared --enable-gpl --enable-nonfree --enable-postproc --enable-swscale --enable-pthreads --enable-x11grab --enable-libx264 --enable-libxvid --enable-libvorbis --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libaacplus
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 1 / 52.59. 0
libavformat 52.31. 0 / 52.56. 0
libavdevice 52. 1. 0 / 52. 2. 0
libswscale 0. 7. 1 / 0.10. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Apr 9 2010 19:59:08, gcc: 4.1.2 20080704 (Red Hat 4.1.2-46)
At least one output file must be specified
I need your advice.
Thanks,
I also loved your work. but I
I also loved your work. but I am also getting Unknown encoder 'libaacplus'.
Any solution for this?
Shai, there is a way enable
Shai, there is a way enable it for 6ch encoding. it's pretty long so please write if you have managed to solve it and if you didn't - i'll help. Great post btw thanks.
Thanks a lot:) where should I
Thanks a lot:) where should I write you?
Shai
./ffmpeg -i "01- String
./ffmpeg -i "01- String Quartet 11, Op.95 - I. Allegro con brio.wav" -acodec libaacplus -ab 128k AACPlus_128k.mp4
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-nonfree --enable-postproc --enable-swscale --enable-avfilter --enable-pthreads --enable-libamr-nb --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libx264 --enable-libxvid --disable-devices --enable-static --extra-libs=/usr/local/lib/libfaac.a --extra-libs=/usr/local/lib/libfaad.a --extra-libs=/usr/local/lib/libxvidcore.a --extra-libs=/usr/local/lib/libx264.a --extra-libs=/usr/local/lib/libamrnb.a --extra-libs=/usr/local/lib/libmp3lame.a --extra-libs=/usr/local/lib/liba52.a --enable-libaacplus --extra-libs=/usr/local/lib/libaacplus.a
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Jul 17 2009 15:04:28, gcc: 4.2.4
Input #0, wav, from '01- String Quartet 11, Op.95 - I. Allegro con brio.wav':
Duration: 00:02:52.64, bitrate: 1411 kb/s
Stream #0.0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
Output #0, mp4, to 'AACPlus_128k.mp4':
Stream #0.0: Audio: libfaac, 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
[libaacplus @ 0x90523c0]No valid AAC+ SBR configuration found: br=128000, nChAAC=2, srAAC=22050
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
3GPP implementation does not
3GPP implementation does not support bitrates over 64 kbps.
Hey, how can I switch SBR,
Hey,
how can I switch SBR, V2, V1? Is there pass1 and pass2?
Thanks.
it depends on selected
it depends on selected bitrate.
If less and include 44Kbps - then SBR v2 used.
In other cases - SBR v1.
It seems aacplus doesn't want
It seems aacplus doesn't want to go over 64kbps... Any way to force it?
Thanks.
3GPP implementation does not
3GPP implementation does not support bitrates over 64 kbps. If you want to encode with bitrate over 64kbps, it's better to use faac encoder.Here is image, that describes quality of he-aac he-aacv2 and aac-lc codecs depends on bitrate:
3GPP_mushra_18_48kbps_2.gif
I get error compiling
I get error compiling libaacplus.a statically into ffmpeg.
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include ./configure --enable-gpl --enable-nonfree --enable-postproc --enable-swscale --enable-avfilter --enable-pthreads --enable-libamr-nb --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libx264 --enable-libxvid --disable-devices --enable-static --extra-libs=/usr/local/lib/libfaac.a --extra-libs=/usr/local/lib/libfaad.a --extra-libs=/usr/local/lib/libxvidcore.a --extra-libs=/usr/local/lib/libx264.a --extra-libs=/usr/local/lib/libamrnb.a --extra-libs=/usr/local/lib/libmp3lame.a --extra-libs=/usr/local/lib/liba52.a --extra-libs=/usr/local/lib/libaacplus.a --enable-libaacplus
"gcc -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I"/root/ffmpeg-0.5" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -fomit-frame-pointer -pthread -I/usr/local/include/aacplus -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wundef -O3 -fno-math-errno -c -o libavcodec/libaacplus.o libavcodec/libaacplus.c
libavcodec/libaacplus.c:28:22: error: put_bits.h: No such file or directory
libavcodec/libaacplus.c: In function Б─≤put_audio_specific_configБ─≥:
libavcodec/libaacplus.c:79: error: Б─≤PutBitContextБ─≥ undeclared (first use in this function)
libavcodec/libaacplus.c:79: error: (Each undeclared identifier is reported only once
libavcodec/libaacplus.c:79: error: for each function it appears in.)
libavcodec/libaacplus.c:79: error: expected Б─≤;Б─≥ before Б─≤pbБ─≥
libavcodec/libaacplus.c:80: warning: ISO C90 forbids mixed declarations and code
libavcodec/libaacplus.c:82: warning: implicit declaration of function Б─≤init_put_bitsБ─≥
libavcodec/libaacplus.c:82: error: Б─≤pbБ─≥ undeclared (first use in this function)
libavcodec/libaacplus.c:83: warning: implicit declaration of function Б─≤put_bitsБ─≥
libavcodec/libaacplus.c:90: warning: implicit declaration of function Б─≤flush_put_bitsБ─≥
make: *** [libavcodec/libaacplus.o] Error 1
"
put_bits.h moved in newer
put_bits.h moved in newer ffmpeg version
ffmpeg-aacp.diif line 108 -
ffmpeg-aacp.diif
line 108
- +#include "put_bits.h"
+ +#include "bitsream.h"
it seems to compile ok now with FFMPEG 0.5.0
Thanks Tipok!
Same error but unable to fix
Same error but unable to fix with this bitsTream.h
With latest FFMPEG
With latest FFMPEG (git):
Hunk #1 FAILED at 376.
1 out of 1 hunk FAILED -- saving rejects to file libavcodec/Makefile.rej
You have to edit patch for
You have to edit patch for your ffmpeg version
Hi, The aac/mp4 files being
Hi,
The aac/mp4 files being produced can't be played in flash.
Do you have any idea on how to solve this?
Best Regards,
Shai
Yes, i tested various
Yes, i tested various variants of audio specific config bits, and i see that all 3 last bits have to be zero, then flash player can play it. So I fixed if at this patch. Here is my working test file. I installet this file url in JW-flv player wizard
P.S. Just redownload patch, I fixed it now.
Hi Danny, Please send me to
Hi Danny,
Please send me to shai@digital-blonde.com your gcc version bash version and make version..
I got it to work with mingw platform I will send you my notes regarding this.
Best Regards,
Shai
Hi, I really appreciate your
Hi, I really appreciate your work on libaacplus. Thank you! However I still can't get the ffmpeg finding the libaacplus...
I have installed libiconv,gettext,glib and pkg-config. But keep getting this error during libaacplus autogen:
configure.ac:48: error: possibly undefined macro: AC_TYPE_INT16_T
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:49: error: possibly undefined macro: AC_TYPE_INT32_T
configure.ac:50: error: possibly undefined macro: AC_TYPE_INT8_T
configure.ac:51: error: possibly undefined macro: AC_TYPE_UINT16_T
Is it related to x86_64 environment?
Danny
> But keep getting this error
> But keep getting this error during libaacplus autogen:
these macros were introduced in autoconf version 2.59-5 (or 2.59c). Install fresh autoconf (>= 2.59-5) to your system.
> Is it related to x86_64 environment?
No, it's related on autoconf version.
Hi, You got to install
Hi,
You got to install libiconv,gettext,glib and pkg-config and then compile libaacplus and then ffmpeg will find it.
Best Regards,
Shai
i compiled it however i keep
i compiled it however i keep getting libaacplus not found.. i compiled libaacplus like teh read me said however still getting it so i then compiled libaacplus using this
./configure --prefix=/mingw --enable-static --disable-shared
still no go..
Hello, I loved your work on
Hello,
I loved your work on the aacplus reference encoder.. I also used the ffmpeg patch for the integration of it into ffmpeg so far so good :)
I just wanted to know if there is a way to enable it for 6ch encoding?
Best Regards,
Shai
This library based on 3gp
This library based on 3gp implementation, that can encode only 1 or 2 channels. So there's no way to encode 6ch.
Post new comment