Skip to content
Normen Hansen edited this page Mar 2, 2018 · 26 revisions

Welcome to the homebridge-camera-ffmpeg wiki!

Raspberry PI

A suggested compilation configuration for ffmpeg on RasPi with enabled hardware H264 ENcoder and DEcoder that can also handle the RasPi internal camera stream as well as audio encoding looks as follows:

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

# 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-decoder=h264 --enable-network --enable-protocol=tcp --enable-demuxer=rtsp
make -j4
sudo make install
  • You can use h264_omx as the "vcodec" parameter in the config.json to use the hardware h264 ENcoder
  • You can use -vcodec h264_mmal before the source URL to use the hardware h264 DEcoder, e.g. -vcodec h264_mmal -re -i rtsp://192.168.2.26/ipcam_h264.sdp

Tips & Troubleshooting

  • If you get choppy playback for RTSP / H264 streams try adding -rtsp_transport tcp before your source URL, e.g. -rtsp_transport tcp -re -i rtsp://192.168.2.26/ipcam_h264.sdp

Clone this wiki locally