diff --git a/README.md b/README.md index e4b9ab9..d99b246 100755 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ View your Nest cams in HomeKit using [Homebridge](https://github.com/nfarina/hom [![NPM](https://nodei.co/npm/homebridge-nest-cam2.png?compact=true)](https://nodei.co/npm/homebridge-nest-cam2/) [![PayPal](https://img.shields.io/badge/paypal-donate-yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=CEYYGVB7ZZ764&item_name=homebridge-nest-cam2¤cy_code=USD&source=url) -[![Discord](https://img.shields.io/discord/681137725071425676)](https://discord.gg/E6dnwsE) +[![Discord](https://img.shields.io/discord/432663330281226270)](https://discord.gg/pc2pqmh) [![Downloads](https://img.shields.io/npm/dt/homebridge-nest-cam2)](https://nodei.co/npm/homebridge-nest-cam2/) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/df36db66217e4b96bd5994b42a6e27f2)](https://www.codacy.com/manual/Brandawg93/homebridge-nest-cam2?utm_source=github.com&utm_medium=referral&utm_content=Brandawg93/homebridge-nest-cam2&utm_campaign=Badge_Grade) @@ -88,7 +88,7 @@ Extra options can be enabled/disabled depending on which switches and sensors yo - streamingSwitch: enable/disable the ability to turn the camera on or off ## Join the Discord -Unfortunately, there is no way for me to test every subscription, camera type, and feature. If you would like to help me test new features and enhancements, join the [Discord Server](https://discord.gg/E6dnwsE) and let me know what you would like to test. Also, if you have general questions or support, feel free to [ask in the server](https://discord.gg/e7bPJnJ). +Unfortunately, there is no way for me to test every subscription, camera type, and feature. If you would like to help me test new features and enhancements, or if you have general questions or need support, join the official [Homebridge Discord Server](https://discord.gg/pc2pqmh). ## Credits This plugin was derived from [homebridge-nest-cam](https://github.com/KhaosT/homebridge-nest-cam) with the new google authentication from [homebridge-nest](https://github.com/chrisjshull/homebridge-nest). diff --git a/lib/streamer.js b/lib/streamer.js index f87e91c..9e12178 100644 --- a/lib/streamer.js +++ b/lib/streamer.js @@ -6,6 +6,7 @@ const PBF = require('pbf'); const EventEmitter = require('events'); const ip = require('ip'); const spawn = require('child_process').spawn; +var pathToFfmpeg = require('ffmpeg-for-homebridge'); const StreamProfile = require('./protos/PlaybackBegin.js').StreamProfile; const PlaybackPacket = require('./protos/PlaybackPacket.js').PlaybackPacket; @@ -435,8 +436,10 @@ class NexusStreamer extends EventEmitter { let ffmpegCommand = '-use_wallclock_as_timestamps 1 -i - -c:v ' + self.ffmpegCodec + ' -an -pix_fmt yuv420p ' + x264Params + '-payload_type 99 -ssrc ' + videoSsrc + ' -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params ' + videoKey.toString('base64') + ' srtp://'+targetAddress+':' + targetVideoPort+'?rtcpport='+targetVideoPort+'&localrtcpport='+targetVideoPort+'&pkt_size=1316'; //audio - https://github.com/KhaosT/homebridge-camera-ffmpeg/issues/9 //ffmpegCommand += ' -c:a libfdk_aac -profile:a aac_eld -vn -ac 1 -ar 16000 -b:a 8000 -flags +global_header -payload_type 110 -ssrc ' + audioSsrc + ' -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params '+audioKey.toString('base64')+' -rtsp_transport tcp srtp://'+targetAddress+':'+targetAudioPort+'?rtcpport='+targetAudioPort+'&localrtcpport='+targetAudioPort+'&pkt_size=188'; - - let ffmpeg = spawn('ffmpeg', ffmpegCommand.split(' '), {env: process.env}); + if (typeof pathToFfmpeg === void 0) { + pathToFfmpeg = 'ffmpeg'; + } + let ffmpeg = spawn(pathToFfmpeg, ffmpegCommand.split(' '), {env: process.env}); ffmpeg.stdin.on('error', (e) => { if (e.code !== 'EPIPE') { self.log.error(e.code); diff --git a/package.json b/package.json index 0c68b9f..66a471d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-nest-cam2", - "version": "1.1.7", + "version": "1.1.8", "description": "Nest cam plugin for homebridge: https://homebridge.io/", "license": "ISC", "keywords": [ @@ -20,7 +20,8 @@ "dependencies": { "ip": "^1.1.3", "pbf": "^3.1.0", - "axios": "^0.19.2" + "axios": "^0.19.2", + "ffmpeg-for-homebridge": "^0.0.3" }, "devDependencies": { "eslint": "^6.8.0"