Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't manage to add libfdk_aac to ffmpeg presets #211

Open
fppont opened this issue May 3, 2016 · 5 comments
Open

Can't manage to add libfdk_aac to ffmpeg presets #211

fppont opened this issue May 3, 2016 · 5 comments

Comments

@fppont
Copy link

fppont commented May 3, 2016

Hello,

We're trying to recompile ffmpeg project with the --enable-libfdk-aac, the build works, but we can't use libfdk_aac to decode an audio_stream.

We are calling : avcodec_find_decoder_by_name("libfdk_aac") and getting the following result:

Exception: avcodec_find_decoder() error: Unsupported audio format or codec not found: 86018.

We've modified the ccpbuild.sh in the ffmpeg directory in the following way:
1- Added the instruction
--enable-libfdk-aac in the ENABLE variable
2- Getting the dependency :
download https://github.com/mstorsjo/fdk-aac/tarball/master fdk-aac.tar.gz
3- Unpacking it:
tar -xzvf ../fdk-aac.tar.gz
4- Installing it:

cd ../mstorsjo-fdk-aac*
autoreconf -fiv
./configure --prefix=$INSTALL_PATH --disable-shared --with-pic
make -j $MAKEJ
make install

The process seems to be ok, and I can compile the project properly with maven, but then it does not work when I'm calling the codec "libfdk_aac".
I was wondering if I'm doing something wrong, or is there any other place where I need to register this codec ? (especially since this is an external library)

Many Thanks

@fppont
Copy link
Author

fppont commented Jul 1, 2016

Quick update: we finally managed to make it work (at least on MacosX) with the above config - still having some troubles recompiling the whole project for linux. Will post the full solution and walkthrough once it works on linux.

@saudet
Copy link
Member

saudet commented Jul 2, 2016

Please use Docker for Linux builds:
https://github.com/bytedeco/javacpp-presets/wiki/Build-Environments#linux-x86-and-x86_64

@saudet
Copy link
Member

saudet commented Jul 4, 2016

Thanks in advance for the contribution!

@fppont
Copy link
Author

fppont commented Jul 4, 2016

No worries :)
In the end there were not any issue with the javacpp presets for ffmpeg. The way we added libfdk in the preset (as I described it in my very first post), was correct.

However in the FFmpegFrameGrabber class in Javacv, we were missing a method to "force" an audio codec when decoding the media.
We've modified this class to add a setAudioCodecName method and this is now working properly.
We can then set libfdk_aac (or any other codec) to decode audio, or encode audio with it using the FFmpegFrameRecorder.

We can close this issue, but that could be interesting to commit this method (and the related amends) to the javacv project.

@saudet
Copy link
Member

saudet commented Jul 4, 2016

Yes of course it would be good to add the modifications. Please send pull requests when you're done with them! Thanks

@bradh bradh removed their assignment Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants