FFmpeg plugin for Homebridge.
Basic Installation:
- Install this plugin using:
npm install -g --unsafe-perm homebridge-camera-ffmpeg
- Edit
config.json
and add the camera.
Install via Homebridge Config UI X:
- Search for
Camera FFmpeg
on the plugin screen of the Homebridge UI. - Install the
homebridge-camera-ffmpeg
and use the form to enter your camera settings.
After paring and restarting Homebridge, each camera you defined will be automatically added into the Home app.
- To Pair Homebridge:
- Open the Home app on your device.
- Tap the Home tab, then tap .
- Tap Add Accessory, and select I Don't Have a Code or Cannot Scan.
- Select Homebridge, this will display as a bridge.
- Enter the Homebridge PIN, this can be found under the QR code in Homebridge UI or your Homebridge logs, alternatively you can select Use Camera and scan the QR code again.
- Your cameras will then be automatically added to HomeKit.
- For help and examples of common configurations please read the wiki.
{
"platform": "Camera-ffmpeg",
"cameras": [
{
"name": "Camera Name",
"videoConfig": {
"source": "-i rtsp://myfancy_rtsp_stream",
"stillImageSource": "-i http://faster_still_image_grab_url/this_is_optional.jpg",
"maxStreams": 2,
"maxWidth": 1280,
"maxHeight": 720,
"maxFPS": 30
}
}
]
}
motion
enable a dummy switch and motion sensor to trigger picture notifications in iOS 13, defaults tofalse
. See wiki for more detailed instructions.doorbell
enable doorbell function for this camera (image notifications). When enabled there will be an additional switch that triggers the doorbell event, automate it to use it with other HomeKit switches, HTTP events etc.manufacturer
set manufacturer name for display in the Home appmodel
set model for display in the Home appserialNumber
set serial number for display in the Home appfirmwareRevision
set firmware revision for display in the Home app
Example with manufacturer, model, serial number and firmware set:
{
"platform": "Camera-ffmpeg",
"cameras": [
{
"name": "Camera Name",
"manufacturer": "ACME, Inc.",
"model": "ABC-123",
"serialNumber": "1234567890",
"firmwareRevision": "1.0",
"videoConfig": {
"source": "-i rtsp://myfancy_rtsp_stream",
"stillImageSource": "-i http://faster_still_image_grab_url/this_is_optional.jpg",
"maxStreams": 2,
"maxWidth": 1280,
"maxHeight": 720,
"maxFPS": 30
}
}
]
}
maxStreams
is the maximum number of streams that will be generated for this camera, default 2maxWidth
is the maximum width reported to HomeKit, default1280
maxHeight
is the maximum height reported to HomeKit, default720
maxFPS
is the maximum frame rate of the stream, default10
minBitrate
is the minimum bit rate of the stream in kbit/s, default0
maxBitrate
is the maximum bit rate of the stream in kbit/s, default300
preserveRatio
can be set to eitherW
orH
with respective obvious meanings, all other values have no effectvcodec
If you're running on a RPi with the omx version of ffmpeg installed, you can change to the hardware accelerated video codec with this option, defaultlibx264
audio
can be set to true to enable audio streaming from camera, defaultfalse
.acodec
Default audio codec islibfdk_aac
and is enabled in the bundled ffmpeg version.packetSize
If audio or video is choppy try a smaller value, set to a multiple of 188, default1316
vflip
Flips the stream vertically, defaultfalse
hflip
Flips the stream horizontally, defaultfalse
mapvideo
Select the stream used for video, default0:0
mapaudio
Select the stream used for audio, default0:1
videoFilter
Allows a custom video filter to be passed to FFmpeg via-vf
, defaults toscale=1280:720
additionalCommandline
Allows additional of extra command line options to FFmpeg, for example'-loglevel verbose'
debug
Show the output of ffmpeg in the log, defaultfalse
A somewhat complicated example:
{
"platform": "Camera-ffmpeg",
"cameras": [
{
"name": "Camera Name",
"videoConfig": {
"source": "-i rtsp://myfancy_rtsp_stream",
"stillImageSource": "-i http://faster_still_image_grab_url/this_is_optional.jpg",
"maxStreams": 2,
"maxWidth": 1280,
"maxHeight": 720,
"maxFPS": 30,
"maxBitrate": 200,
"vcodec": "h264_omx",
"audio": false,
"packetSize": 188,
"hflip": true,
"additionalCommandline": "-x264-params intra-refresh=1:bframes=0",
"debug": true
}
}
]
}
videoProcessor
is the video processor used to manage videos. eg: ffmpeg (by default) or avconv or /a/path/to/another/ffmpeg. Need to use the same parameters than ffmpeg.
{
"platform": "Camera-ffmpeg",
"videoProcessor": "avconv",
"cameras": [
...
]
}
{
"platform": "Camera-ffmpeg",
"videoProcessor": "/my/own/compiled/ffmpeg",
"cameras": [
...
]
}
interfaceName
selects the IP address of a given network interface. The default is to select the first available, and that may not be the same IP address that ffmpeg will use. A mismatch will cause the iOS device to discard the video stream.
{
"platform": "Camera-ffmpeg",
"interfaceName": "bond0",
"cameras": [
...
]
}
We have started collecting tested configurations in the wiki, so please before raising an issue with your configuration, please check the wiki. Also if you have a working configuration that you would like to share, please add it to the wiki.
https://github.com/homebridge-plugins/homebridge-camera-ffmpeg/wiki
Homebridge Camera FFmpeg was originally created by Khaos Tian.