1
votes

I am trying to convert raw PCM to aac .So i am trying to achieve it through ffmpeg.

My ffmepg configuration

--enable-cross-compile --arch=arm --cpu=armv6 --enable-asm --target-os=linux --disable-stripping --enable-neon --enable-version3 --disable-shared --enable-static --enable-gpl --enable-memalign-hack --cc=arm-linux-androideabi-gcc --ld=arm-linux-androideabi-ld --extra-cflags='-fPIC -DANDROID -D_thumb_ -mthumb -Wfatal-errors -Wno-deprecated -marm -march=armv6 ' --disable-everything --enable-encoder=aac --enable-decoder=h264 --enable-hwaccels --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-network --enable-filter=buffer --enable-filter=buffersink --disable-demuxer=v4l --disable-demuxer=v4l2 --disable-indev=v4l --disable-indev=v4l2

avcodec_find_encoder(CODEC_ID_AAC)  find's the AAC encoder succesfully.

audio_context= avcodec_alloc_context()
avcodec_open(audio_context, audio_encoder)  failed to open aac 

any idea?

2

2 Answers

0
votes

I think the answer is going to be in the ffmpeg portion of the logcat. You should get debug level logging turned on in your ffmpeg libs and capture the log to find out where the codec_open statement is failing.

provide the log here.

0
votes

Instead of using ffmpeg inbuilt aac encoder try using libfaac.

First of all cross compile libfaac for android.

in ffmpeg --extra-cflags provide path to your compiled libfaac's include directory.

in --extra-ldflags provide path to your compiled libfaac's lib directory.

in ffmpeg config.sh use --enable-libfaac

Compile ffmpeg again with libfaac.