Skip to content
donavanbecker edited this page Jan 10, 2020 · 15 revisions

Homebridge Audio Support

To use audio with the homebridge-ring plugin, you must have ffmpeg installed with the libfdk_aac library. Find your operating system below and run the suggested commands.

Once you have ffmpeg with libfdk_aac installed on your homebridge server, you should immediately be able to receive audio in your camera streams. There are a few known issues at this point:

  • Audio takes a few seconds to start after video stream appears - this lag time is due to ffmpeg taking some time to start up. I might be able to reduce this delay in the future, but no promises.
  • No two-way audio yet

Debian Linux (NOOBS/HOOBS/Raspbian on raspberry pi)

These instructions are borrowed from https://github.com/KhaosT/homebridge-camera-ffmpeg/wiki/Raspberry-PI

# install build tools
sudo apt-get install git pkg-config autoconf automake libtool libx264-dev

# download and build fdk-aac
git clone https://github.com/mstorsjo/fdk-aac.git
cd fdk-aac
./autogen.sh
./configure --prefix=/usr/local --enable-shared --enable-static
make -j4
sudo make install
sudo ldconfig
cd ..

# download and build ffmpeg
git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg
./configure --prefix=/usr/local --arch=armel --target-os=linux --enable-omx-rpi --enable-nonfree --enable-gpl --enable-libfdk-aac --enable-mmal --enable-libx264 --enable-decoder=h264 --enable-network --enable-protocol=tcp --enable-demuxer=rtsp
make -j4
sudo make install

Alpine Linux (docker-homebridge)

First, access the docker image:

# access docker container shell (I recommend this vs the web UI, as the web UI may time out)
cd /home/pi/homebridge
docker-compose exec homebridge sh

Then, install/build ffmpeg. These commands may work, but have not been tested. Pulled from https://github.com/oznu/docker-homebridge/issues/82#issuecomment-374497842

apk del ffmpeg ffmpeg-libs
apk --allow-untrusted add --no-cache --repository http://alpine.dl.oz.nu/ffmpeg ffmpeg ffmpeg-libs

If those commands fail, try these commands courtesy of @ifeign in #114

# install build tools
apk add git pkgconfig autoconf automake libtool x264-dev

# download and build fdk-aac
git clone https://github.com/mstorsjo/fdk-aac.git
cd fdk-aac
./autogen.sh
./configure --prefix=/usr/local --enable-shared --enable-static
make -j4
sudo make install
sudo ldconfig
cd ..

# download and build ffmpeg
git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg
./configure --prefix=/usr/local --arch=armel --target-os=linux --enable-nonfree --enable-gpl --enable-libfdk-aac --enable-libx264 --enable-decoder=h264 --enable-network --enable-protocol=tcp --enable-demuxer=rtsp
make -j4
sudo make install

MacOS

From https://stackoverflow.com/questions/55092608/enabling-libfdk-aac-in-ffmpeg-installed-with-homebrew

brew tap homebrew-ffmpeg/ffmpeg
brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-fdk-aac

Other Platforms

If you are running homebridge on a different platform, you will need to research how to build ffmpeg. The most important part is that you include --enable-libfdk-aac when building ffmpeg to enable the libfdk_aac codec.

Clone this wiki locally