Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#42190 closed enhancement (fixed)

Can ffmpeg be built with libfdk_aac (--enable-libfdk-aac)?

Reported by: ClintO (Clint O) Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: aac Cc: jeremyhu (Jeremy Huddleston Sequoia), larryv (Lawrence Velázquez), mopihopi
Port: ffmpeg

Description

I've downloaded what I believe to be the fdk-aac library (the ffmpeg is especially obtuse on this), and it says you must enable some configure switches in order to use this library. I noticed there is a +nonfree variant, but this just seems to include faac.

I was curious if this variant is possible. If necessary, I can build it myself, but I was hoping to leverage the ports system as much as possible.

Thanks...

Attachments (3)

Portfile (981 bytes) - added by mopihopi 10 years ago.
Portfile for libfdk-aac
ffmpeg-fdk.patch (1.0 KB) - added by mopihopi 10 years ago.
ffmpeg Portfile patch to add libfdk-aac
ffmpeg-devel-fdk.patch (1.0 KB) - added by mopihopi 10 years ago.
ffmpeg-devel Portfile patch to add libfdk-aac

Download all attachments as: .zip

Change History (18)

comment:1 Changed 10 years ago by larryv (Lawrence Velázquez)

Cc: devans@… openmaintainer@… removed
Keywords: ffmpeg nonfree removed
Owner: changed from macports-tickets@… to devans@…

comment:2 Changed 10 years ago by dbevans (David B. Evans)

Status: newassigned

comment:3 Changed 10 years ago by dbevans (David B. Evans)

Keywords: aac added

This requires the FDK AAC library developed by Fraunhofer IIS for Android which has not yet been ported to MacPorts. Licensing also needs to be reviewed.

Sources can be found here -> http://sourceforge.net/projects/opencore-amr/files/fdk-aac/

Will look into it. If you have already developed a Portfile for the library, feel free to contribute it for review (you can attach it to this ticket).

Note that ffmpeg already has its own implementation of AAC (codecs aac, aac-latm) which is GPL'd as well as the non-free version based on faac.

ffmpeg -decoders | grep aac
ffmpeg version 2.1.git-3ca7085 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jan 17 2014 17:30:13 with Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-libdc1394 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  libavutil      52. 62.100 / 52. 62.100
  libavcodec     55. 48.101 / 55. 48.101
  libavformat    55. 23.103 / 55. 23.103
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  1.100 /  4.  1.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
 A....D aac                  AAC (Advanced Audio Coding)
 A....D aac_latm             AAC LATM (Advanced Audio Coding LATM syntax)

comment:4 Changed 10 years ago by ClintO (Clint O)

I wouldn't mind contributing a portfile if I knew what the heck I was doing. If there's a pointer on how to modify a port, I'll see if it's within my paygrade. It seems like since libfdk_aac is not yet a port that this would be a showstopper. I just took your configure arguments and added support for libfdk_aac. The only issue is that I do get a library configuration mismatch when I try to run ffmpeg -codecs:

ffmpeg version 2.1.3 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan 19 2014 11:34:21 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfaac --enable-libfdk-aac
  WARNING: library configuration mismatch
  avutil      configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfaac
  avcodec     configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfaac
  avformat    configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfaac
  avdevice    configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfaac
  avfilter    configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfaac
  avresample  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfaac
  swscale     configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfaac
  swresample  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfaac
  postproc    configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfaac

I'm not entirely sure where the mismatch is happening.

comment:5 Changed 10 years ago by ClintO (Clint O)

Oh, I forgot to mention about the builtin aac and faac support.

The ffmpeg documentation clearly states that the Fraunhofer codec is a superior implementation to the still experimental builtin aac and even faac. So if fidelity is a goal, then there is a compelling reason to use this codec.

You can see the entire diatribe here: http://trac.ffmpeg.org/wiki/AACEncodingGuide

comment:6 Changed 10 years ago by larryv (Lawrence Velázquez)

Cc: larryv@… added

Cc Me!

Changed 10 years ago by mopihopi

Attachment: Portfile added

Portfile for libfdk-aac

comment:7 Changed 10 years ago by mopihopi

Cc: mopihopi@… added

Cc Me!

comment:8 Changed 10 years ago by mopihopi

devans: Is there anything else that is needed to add the libfdk-aac Portfile (attached above)? I'll attach patches for the ffmpeg and ffmpeg-devel Portfile as well.

Changed 10 years ago by mopihopi

Attachment: ffmpeg-fdk.patch added

ffmpeg Portfile patch to add libfdk-aac

Changed 10 years ago by mopihopi

Attachment: ffmpeg-devel-fdk.patch added

ffmpeg-devel Portfile patch to add libfdk-aac

comment:9 Changed 10 years ago by dbevans (David B. Evans)

I'm planning to include this as part of an upgrade to ffmpeg 2.1.4 in the next day or so.

comment:10 in reply to:  8 ; Changed 10 years ago by dbevans (David B. Evans)

Replying to mopihopi@…:

devans: Is there anything else that is needed to add the libfdk-aac Portfile (attached above)?

Concerning your compiler.blacklist statement: have you verified that this is sufficient on OS X 10.6 (SL) or earlier. I suspect that this should be expanded to include other gcc-4.2 versions and perhaps clang < 300 which is available on that platform and is not well behaved somethimes. I can't test this locally and would have to defer this testing to the SL buildbot.

Very minor issue: revision 0 is the default and can be omitted.

comment:11 Changed 10 years ago by dbevans (David B. Evans)

I don't like committing a port with nomaintainer. Since this is your creation would you be willing to accept maintainership with openmaintainer?

comment:12 in reply to:  10 Changed 10 years ago by mopihopi

Replying to devans@…:
Sounds good.

libfdk-aac does build using gcc-4.2 on OS X 10.6.8, however it crashed at runtime on some samples. Blacklisting gcc-4.2 resolved the issue. llvm-gcc-4.2 and clang on OS X 10.6.8 seem to both work fine.

I don't mind maintaining this Portfile with openmaintainer if you don't want to maintain it.

comment:13 Changed 10 years ago by dbevans (David B. Evans)

libfdk-aac committed in r117505 with modifications:

  • added maintainer with openmaintainer
  • remove port group compiler_blacklist_versions (only needed if you want to specify compiler version comparisons in compiler.blacklist)
  • added fix for livecheck (default livecheck fails to report current version 1.3 in this case)
  • reformating for readability

Builds correctly on all buildbots

Thanks for accepting maintainership of this new port.

comment:14 Changed 10 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: assignedclosed

ffmpeg updated to version 2.1.4 with libfdk-aac support (+nonfree only) in r117554.
ffmpeg-devel updated to recent git master with libfdk-aac support (+nonfree only) in r117555.

comment:15 Changed 10 years ago by ClintO (Clint O)

I really appreciate the enhancement. I updated the port and ran ffmeg -codecs to confirm in fact that it's in there:

% ffmpeg -codecs |& grep fdk
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfdk-aac --enable-libfaac
 DEA.L. aac                  AAC (Advanced Audio Coding) (decoders: aac libfdk_aac ) (encoders: aac libfaac libfdk_aac )

Thanks,

-Clint

Note: See TracTickets for help on using tickets.