Sunoo / homebridge-camera-ffmpeg

Homebridge Plugin Providing FFmpeg-based Camera Support
https://sunoo.github.io/homebridge-camera-ffmpeg/
Apache License 2.0
1.09k stars 225 forks source link

Homebridge crashes after upgrading to latest 0.1.19 #483

Closed verisgit closed 4 years ago

verisgit commented 4 years ago

After upgrading homebridge-camera-ffmpeg to the latest version homebridge crashes on startup with the below error:

[5/5/2020, 10:49:34 PM] ==================== [5/5/2020, 10:49:34 PM] ERROR LOADING PLUGIN homebridge-camera-ffmpeg: [5/5/2020, 10:49:34 PM] Error: No valid exports main found for '/usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/uuid' at resolveExportsTarget (internal/modules/cjs/loader.js:618:9) at applyExports (internal/modules/cjs/loader.js:499:14) at resolveExports (internal/modules/cjs/loader.js:548:12) at Function.Module._findPath (internal/modules/cjs/loader.js:650:22) at Function.Module._resolveFilename (internal/modules/cjs/loader.js:948:27) at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:61:29) at require (internal/modules/cjs/helpers.js:72:18) at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/googleapis-common/build/src/apirequest.js:19:14) at Module._compile (internal/modules/cjs/loader.js:1128:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) [5/5/2020, 10:49:34 PM] ==================== [5/5/2020, 10:49:34 PM] Error loading platform requested in your config.json at position 1 [5/5/2020, 10:49:34 PM] Error: The requested platform 'Camera-ffmpeg' was not registered by any plugin. at PluginManager.getPluginForPlatform (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:223:15) at /usr/local/lib/node_modules/homebridge/src/server.ts:386:37 at Array.forEach (<anonymous>) at Server.loadPlatforms (/usr/local/lib/node_modules/homebridge/src/server.ts:373:27) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:152:29) at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:78:10) at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1128:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) at Module.load (internal/modules/cjs/loader.js:983:32)

It was working fine prior to the upgrade; however, I don't know what version I was on previously so I'm having trouble rolling back to it. I tried upgrading npm also to see if that was the issue but it did not seem to help.

Any ideas?

verisgit commented 4 years ago

I've tried reinstalling it from scratch, using the OOTB settings builder, etc. I've ruled out the issue being incompatible config. If the platform is listed in the config home bridge crashes as soon as it reaches that line.

It was previously working fine for several months until I did the following yesterday: -updated homebridge-camera-ffmpeg to the latest version -updated Homebridge Config UI X to the latest version Restarted - home bridge immediately crashed and homebridge-camera-ffmpeg has been unrecoverable since.

I then tried the following: -Updated NPM Still kept crashing

Gave up and: -Removed homebridge-camera-ffmpeg from config.json - everything works fine again.

Config I tested with just to see if mine was suddenly incompatible: { "platform": "Camera-ffmpeg", "cameras": [ { "name": "Test", "videoConfig": { "source": "-re -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 } } ] } This also failed

I'm running homebridge on FreeNAS (FreeBSD) and I have FFmpeg running in this homebridge container:

root@homebridge:/ # ffmpeg ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers built with FreeBSD clang version 8.0.0 (tags/RELEASE_800/final 356365) (based on LLVM 8.0.0) configuration: --prefix=/usr/local --mandir=/usr/local/man --datadir=/usr/loca l/share/ffmpeg --pkgconfigdir=/usr/local/libdata/pkgconfig --enable-shared --ena ble-pic --enable-gpl --enable-avresample --cc=cc --disable-alsa --disable-libope ncore-amrnb --disable-libopencore-amrwb --enable-libaom --disable-libaribb24 --d isable-libass --disable-libbs2b --disable-libcaca --disable-libcdio --disable-li bcelt --disable-libcodec2 --enable-libdav1d --disable-libdavs2 --disable-libdc13 94 --disable-debug --enable-htmlpages --disable-libdrm --disable-libfdk-aac --di sable-libflite --enable-fontconfig --enable-libfreetype --enable-frei0r --disabl e-libfribidi --disable-gcrypt --disable-libgme --enable-gmp --enable-gnutls --en able-version3 --disable-libgsm --enable-iconv --disable-libilbc --disable-libjac k --disable-libklvanc --disable-libkvazaar --disable-ladspa --disable-libmp3lame --disable-liblensfun --disable-libbluray --disable-librsvg --disable-librtmp -- disable-libxml2 --disable-lto --disable-lv2 --disable-mbedtls --disable-libmfx - -enable-mmx --disable-libmodplug --disable-libmysofa --disable-nonfree --disable -openal --disable-opencl --enable-libopencv --disable-opengl --disable-libopenh2 64 --disable-libopenjpeg --disable-libopenmpt --disable-openssl --enable-optimiz ations --enable-libopus --disable-pocketsphinx --disable-libpulse --disable-libr av1e --enable-runtime-cpudetect --disable-librubberband --disable-sdl2 --disable -libsmbclient --disable-libsnappy --disable-sndio --disable-libsoxr --disable-li bspeex --disable-libsrt --enable-sse --disable-libssh --disable-libtensorflow -- disable-libtesseract --enable-libtheora --disable-libtwolame --enable-libv4l2 -- enable-vaapi --disable-vapoursynth --enable-vdpau --disable-libvidstab --disable -libvmaf --enable-libvorbis --disable-libvo-amrwbenc --enable-libvpx --disable-l ibwavpack --disable-libwebp --enable-libx264 --enable-libx265 --disable-libxavs2 --enable-libxcb --enable-libxvid --disable-outdev=xv --disable-libzimg --disabl e-libzmq --disable-libzvbi libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfi le}...

Use -h to get full help or, even better, run 'man ffmpeg'

If anyone has any suggestions on how to get this working again it would be great. I really like this plugin.

rrrrrk commented 4 years ago

Same issue under windows. I tried uninstalling, homebridge runs fine. Installed with barebones config and I get nearly the same crash as you do.

[5/6/2020, 10:36:28 AM] [HB Supervisor] Homebridge Process Ended. Code: 1, Signal: null
[5/6/2020, 10:36:33 AM] [HB Supervisor] Restarting Homebridge...
[5/6/2020, 10:36:33 AM] [HB Supervisor] Starting Homebridge with extra flags: -K
[5/6/2020, 10:36:33 AM] [HB Supervisor] Started Homebridge v1.0.4 with PID: 4500
[5/6/2020, 10:36:33 AM] Loaded config.json with 0 accessories and 2 platforms.
[5/6/2020, 10:36:33 AM] ---
[5/6/2020, 10:36:33 AM] ====================
[5/6/2020, 10:36:33 AM] ERROR LOADING PLUGIN homebridge-camera-ffmpeg:
[5/6/2020, 10:36:33 AM] Error: No valid exports main found for 'C:\Users\USERFOLDER\AppData\Roaming\npm\node_modules\homebridge-camera-ffmpeg\node_modules\uuid'
    at resolveExportsTarget (internal/modules/cjs/loader.js:611:9)
    at applyExports (internal/modules/cjs/loader.js:492:14)
    at resolveExports (internal/modules/cjs/loader.js:541:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:643:22)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:941:27)
    at Function.Module._load (internal/modules/cjs/loader.js:847:27)
    at Module.require (internal/modules/cjs/loader.js:1016:19)
    at require (internal/modules/cjs/helpers.js:69:18)
    at Object.<anonymous> (C:\Users\USERFOLDER\AppData\Roaming\npm\node_modules\homebridge-camera-ffmpeg\node_modules\googleapis-common\build\src\apirequest.js:19:14)
    at Module._compile (internal/modules/cjs/loader.js:1121:30)
[5/6/2020, 10:36:33 AM] ====================
[5/6/2020, 10:36:33 AM] Loaded plugin: homebridge-config-ui-x
[5/6/2020, 10:36:33 AM] Registering platform 'homebridge-config-ui-x.config'
[5/6/2020, 10:36:33 AM] ---
[5/6/2020, 10:36:33 AM] Loading 2 platforms...
[5/6/2020, 10:36:33 AM] [Config] Initializing config platform...
[5/6/2020, 10:36:33 AM] [Config] Running in Service Mode
[5/6/2020, 10:36:33 AM] Error loading platform requested in your config.json at position 2
[5/6/2020, 10:36:33 AM] Error: The requested platform 'Camera-ffmpeg' was not registered by any plugin.
    at PluginManager.getPluginForPlatform (C:\Users\USERFOLDER\AppData\Roaming\npm\node_modules\homebridge\src\pluginManager.ts:223:15)
    at C:\Users\USERFOLDER\AppData\Roaming\npm\node_modules\homebridge\src\server.ts:386:37
    at Array.forEach (<anonymous>)
    at Server.loadPlatforms (C:\Users\USERFOLDER\AppData\Roaming\npm\node_modules\homebridge\src\server.ts:373:27)
    at Server.start (C:\Users\USERFOLDER\AppData\Roaming\npm\node_modules\homebridge\src\server.ts:152:29)
    at cli (C:\Users\USERFOLDER\AppData\Roaming\npm\node_modules\homebridge\src\cli.ts:78:10)
    at Object.<anonymous> (C:\Users\USERFOLDER\AppData\Roaming\npm\node_modules\homebridge\bin\homebridge:17:22)
    at Module._compile (internal/modules/cjs/loader.js:1121:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1160:10)
    at Module.load (internal/modules/cjs/loader.js:976:32)
rrrrrk commented 4 years ago

I was able to get this working again by reinstalling node.js and restoring my homebridge backup file.

verisgit commented 4 years ago

Why would we need to uninstall and reinstall node-js to get the plugin working when all we did was upgrade the plugin. That makes no sense.

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

verisgit commented 4 years ago

Did anyone get this working again?