1

I'm trying to use FFmpeg to encode files with the iLBC codec, e.g.:

ffmpeg -i audio.wav -ar 8000 -acodec ilbc audio.lbc -y

This worked fine on Windows, however on Mac OS X I'm getting the error Unknown encoder 'ilbc'.

The official FFmpeg documentation has this to say about libilbc:

Go to https://github.com/dekkers/libilbc and follow the instructions for installing the library. Then pass --enable-libilbc to configure to enable it.

I've never compiled a library before so I tried my luck editing the brew recipe, adding these lines where appropriate:

option "with-libilbc", "Enable iLBC library
args << "--enable-libilbc" if build.with? "libilbc"

Then reinstalling ffmpeg with brew install ffmpeg --with-libilbc. However, that just causes the build to fail and I don't see any message error pertaining to iLBC. My assumption is that the library is simply missing at this point anyway.

Hence my questions:

  • How can I compile the libilbc mentioned in the FFmpeg doc for Mac OS X?
  • Can I then connect it to brew somehow so as to rebuild ffmpeg with it?
4
  • FYI, the error messages while building ffmpeg were not helpful quite simply because they were being truncated. Using the -v flag fixed that and helped see what the problem was. Jan 13, 2015 at 8:50
  • Would you consider making libilbc as a formula, and making that and your changes to ffmpeg a pull request?
    – slhck
    Jan 13, 2015 at 16:18
  • Sure. I've never done it before but I'll try my hand at it. Jan 14, 2015 at 12:53
  • Would be nice. I can also try but I don't have so much time at the moment :)
    – slhck
    Jan 14, 2015 at 14:47

2 Answers 2

3

The repository you linked is missing a configure file, even though the installation file mentioned it. This looks like a better repository https://github.com/Distrotech/libilbc-webrtc

so what you do is

git clone https://github.com/Distrotech/libilbc-webrtc.git
cd libilbc-webrtc
./configure
make
make install

then after don't forget to actually use the option you added in the brew file like so:

brew install --with-ilbc -v
1
  • Regarding the libilbc repository mentioned in the FFmpeg docs: running autoreconf -fiv will create the configure file.
    – llogan
    Jan 13, 2015 at 1:10
1

I gave up of using ffmpeg for this. I solved the problem using afconvert (included by default on MacOS). For example:

afconvert test.mp3 -o test.caf -d ilbc
2
  • But the OP specified ffmpeg.
    – suspectus
    Apr 17, 2015 at 16:12
  • I solved the issue with the selected answer but I'm glad to know about this alternative. Apr 17, 2015 at 16:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .